Class Nethttpd_reactor.http_reactor


class http_reactor : #http_reactor_config -> Unix.file_descr -> object .. end
The http_reactor allows one to pull the next request from a connected client, and to deliver the response to the protocol engine.

method next_request : unit -> http_reactive_request option
Tries to read the next request. When the header of the request is successfully read, the method returns the request object (see above). It is connected with the socket and can read the request body.

After receiving the request, one must either call accept_body when the request is acceptable and one want to reply afer evaluating the body, or invoke reject_body when the request can be denied without looking at the body. One must also call accept_body when there is not any body (it is a no-op then). The HTTP protocol explicitly forbids to perform the request when reject_body has been invoked ("The origin server MUST NOT perform the requested method if it returns a final status code").

The response must be written to the Netcgi environment. Depending on config_reactor_synch the response is immediately transmitted to the client or at some specified time in the future (untransmitted data is buffered in this case).

While transmitting output, the reactor is able to read the next request in the background when the limits for the pipeline size allows equemitting output, the reactor is able to read the next request in the background when the limits for the pipeline size allows equemitting output, the reactor is able to read the next request in the background when the limits for the pipeline size allows equemitting output, the reactor is able to read the next request in the background when the limits for the pipeline size allows equemitting output, the reactor is able to read the next request in the background when the limits for the pipeline size allows equemitting output, the reactor is able to read the next request in the background when the limits for the pipeline size allows equemitting output, the reactor is able to read the next request in the background when the limits for the pipeline size allows equemitting output, the reactor is able to read the next request in the background when the limits for the pipeline size allows equemitting output, the reactor is able to read the next request in the background when