From: Amos Jeffries Date: Tue, 17 Nov 2015 05:58:08 +0000 (-0800) Subject: Docs: Update ConnStateData and ClientServerContext descriptions X-Git-Tag: SQUID_4_0_3~5^2~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=434fe01480e773c9439314f0c96368d4ed0e3f91;p=thirdparty%2Fsquid.git Docs: Update ConnStateData and ClientServerContext descriptions --- diff --git a/src/client_side.h b/src/client_side.h index dbc082c5bd..6bb81dee53 100644 --- a/src/client_side.h +++ b/src/client_side.h @@ -37,24 +37,36 @@ class PortCfg; /** * Badly named. - * This is in fact the processing context for a single HTTP request. + * This is in fact the processing context for a single HTTP transaction. * - * Managing what has been done, and what happens next to the data buffer - * holding what we hope is an HTTP request. + * A context lifetime extends from directly after a request has been parsed + * off the client connection buffer, until the last byte of both request + * and reply payload (if any) have been written. * - * Parsing is still a mess of global functions done in conjunction with the - * real socket controller which generated ClientHttpRequest. - * It also generates one of us and passes us control from there based on - * the results of the parse. + * (NOTE: it is not certain yet if an early reply to a POST/PUT is sent by + * the server whether the context will remain in the pipeline until its + * request payload has finished being read. It is supposed to, but may not) * - * After that all the request interpretation and adaptation is in our scope. - * Then finally the reply fetcher is created by this and we get the result - * back. Which we then have to manage writing of it to the ConnStateData. + * Contexts self-register with the Pipeline being managed by the Server + * for the connection on which the request was received. * - * The socket level management is done by a ConnStateData which owns us. + * When HTTP/1 pipeline is operating there may be multiple transactions using + * the clientConnection. Only the back() context may read from the connection, + * and only the front() context may write to it. A context which needs to read + * or write to the connection but does not meet those criteria must be shifted + * to the deferred state. + * + * When a context is completed the finished() method needs to be called which + * will perform all cleanup and deregistration operations. If the reason for + * finishing is an error, then notifyIoError() needs to be called prior to + * the finished() method. + * Alternatively the initiateClose() method can be called to terminate the + * whole client connection and all other pending contexts. + * + * The socket level management is done by a Server which owns us. * The scope of this objects control over a socket consists of the data - * buffer received from ConnStateData with an initially unknown length. - * When that length is known it sets the end bounary of our acces to the + * buffer received from the Server with an initially unknown length. + * When that length is known it sets the end boundary of our access to the * buffer. * * The individual processing actions are done by other Jobs which we @@ -151,19 +163,30 @@ namespace Ssl class ServerBump; } #endif + /** - * Manages a connection to a client. + * Legacy Server code managing a connection to a client. + * + * NP: presents AsyncJob API but does not operate autonomously as a Job. + * So Must() is not safe to use. + * + * Multiple requests (up to pipeline_prefetch) can be pipelined. + * This object is responsible for managing which one is currently being + * fulfilled and what happens to the queue if the current one causes the client + * connection to be closed early. + * + * Act as a manager for the client connection and passes data in buffer to a + * Parser relevant to the state (message headers vs body) that is being + * processed. * - * Multiple requests (up to pipeline_prefetch) can be pipelined. This object is responsible for managing - * which one is currently being fulfilled and what happens to the queue if the current one - * causes the client connection to be closed early. + * Performs HTTP message processing to kick off the actual HTTP request + * handling objects (ClientSocketContext, ClientHttpRequest, HttpRequest). * - * Act as a manager for the connection and passes data in buffer to the current parser. - * the parser has ambiguous scope at present due to being made from global functions - * I believe this object uses the parser to identify boundaries and kick off the - * actual HTTP request handling objects (ClientSocketContext, ClientHttpRequest, HttpRequest) + * Performs SSL-Bump processing for switching between HTTP and HTTPS protocols. * - * If the above can be confirmed accurate we can call this object PipelineManager or similar + * To terminate a ConnStateData close() the client Comm::Connection it is + * managing, or for graceful half-close use the stopReceiving() or + * stopSending() methods. */ class ConnStateData : public Server, public HttpControlMsgSink, public RegisteredRunner {