-
Notifications
You must be signed in to change notification settings - Fork 42
Open
Description
the handler file has a lot of plugin handlers, but a number of them are never invoked. Also some are quite obscure (eg the metatable one).
However there seems no way to fix this without some serious breaking changes. Hence I think it makes sense to redesign the handlers all together.
Here's a stab at an updated set of handlers;
newConnection; when a new client tcp socket is created, before reading any data (eg TLS handshake goes here)beforeHeaderRead; after the request line has been read (1st line) before headers have been readafterHeaderRead; after the request headers have been readrequestBody; for each chunk of data read from the request body (can repeat, called once withnilif body is empty). Handlers can cache chunks to prevent further processing by next handler. After last chunk, will be called once more withnilto indicate done.requestComplete; after full request has been readbeforeHeaderSend; before the status line and response headers are being sendafterHeaderSend; after the headers have been sent, but before the body is being processed (also called if there is no body)responseBody; for each chunk of data to be sent in the response body (can repeat, called once withnilif body is empty). Handlers can cache chunks to prevent further processing by next handler. After last chunk, will be called once more withnilto indicate done.responseComplete; after each request is finished
The list doesn't have file send handlers, since imho the file send logic itself should actually be a plugin.
Metadata
Metadata
Assignees
Labels
No labels