2 * Copyright (C) 1996-2016 The Squid Software Foundation and contributors
4 * Squid software is distributed under GPLv2+ license and includes
5 * contributions from numerous individuals and organizations.
6 * Please see the COPYING and CONTRIBUTORS files for details.
9 #ifndef SQUID_SRC_SERVERS_HTTP1SERVER_H
10 #define SQUID_SRC_SERVERS_HTTP1SERVER_H
12 #include "servers/forward.h"
19 /// Manages a connection from an HTTP/1 or HTTP/0.9 client.
20 class Server
: public ConnStateData
25 Server(const MasterXaction::Pointer
&xact
, const bool beHttpsServer
);
28 void readSomeHttpData();
31 /* ConnStateData API */
32 virtual Http::Stream
*parseOneRequest();
33 virtual void processParsedRequest(Http::Stream
*context
);
34 virtual void handleReply(HttpReply
*rep
, StoreIOBuffer receivedData
);
35 virtual void writeControlMsgAndCall(HttpReply
*rep
, AsyncCall::Pointer
&call
);
36 virtual time_t idleTimeout() const;
39 virtual void noteMoreBodySpaceAvailable(BodyPipe::Pointer
);
40 virtual void noteBodyConsumerAborted(BodyPipe::Pointer
);
45 void proceedAfterBodyContinuation(Http::StreamPointer context
);
48 void processHttpRequest(Http::Stream
*const context
);
49 void handleHttpRequestData();
51 /// Handles parsing results. May generate and deliver an error reply
52 /// to the client if parsing is failed, or parses the url and build the
53 /// HttpRequest object using parsing results.
54 /// Return false if parsing is failed, true otherwise.
55 bool buildHttpRequest(Http::Stream
*context
);
57 Http1::RequestParserPointer parser_
;
58 HttpRequestMethod method_
; ///< parsed HTTP method
60 /// temporary hack to avoid creating a true HttpsServer class
61 const bool isHttpsServer
;
67 #endif /* SQUID_SRC_SERVERS_HTTP1SERVER_H */