Http1Server.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1996-2020 The Squid Software Foundation and contributors
3  *
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.
7  */
8 
9 #ifndef SQUID_SRC_SERVERS_HTTP1SERVER_H
10 #define SQUID_SRC_SERVERS_HTTP1SERVER_H
11 
12 #include "servers/forward.h"
13 
14 namespace Http
15 {
16 namespace One
17 {
18 
20 class Server: public ConnStateData
21 {
23 
24 public:
25  Server(const MasterXaction::Pointer &xact, const bool beHttpsServer);
26  virtual ~Server() {}
27 
28  void readSomeHttpData();
29 
30 protected:
31  /* ConnStateData API */
32  virtual Http::Stream *parseOneRequest();
33  virtual void processParsedRequest(Http::StreamPointer &context);
34  virtual void handleReply(HttpReply *rep, StoreIOBuffer receivedData);
35  virtual bool writeControlMsgAndCall(HttpReply *rep, AsyncCall::Pointer &call);
36  virtual int pipelinePrefetchMax() const;
37  virtual time_t idleTimeout() const;
38  virtual void noteTakeServerConnectionControl(ServerConnectionContext);
39 
40  /* BodyPipe API */
43 
44  /* AsyncJob API */
45  virtual void start();
46 
48 
49 private:
50  void processHttpRequest(Http::Stream *const context);
51  void handleHttpRequestData();
52 
58 
59  void setReplyError(Http::StreamPointer &context, HttpRequest::Pointer &request, const HttpRequestMethod& method, err_type requestError, Http::StatusCode errStatusCode, const char *requestErrorBytes);
60 
63 
65  const bool isHttpsServer;
66 };
67 
68 } // namespace One
69 } // namespace Http
70 
71 #endif /* SQUID_SRC_SERVERS_HTTP1SERVER_H */
72 
void handleHttpRequestData()
virtual Http::Stream * parseOneRequest()
Definition: Http1Server.cc:73
virtual bool writeControlMsgAndCall(HttpReply *rep, AsyncCall::Pointer &call)
handle a control message received by context from a peer and call back
Definition: Http1Server.cc:335
Server(const MasterXaction::Pointer &xact, const bool beHttpsServer)
Definition: Http1Server.cc:27
void setReplyError(Http::StreamPointer &context, HttpRequest::Pointer &request, const HttpRequestMethod &method, err_type requestError, Http::StatusCode errStatusCode, const char *requestErrorBytes)
Definition: Http1Server.cc:211
virtual int pipelinePrefetchMax() const
returning N allows a pipeline of 1+N requests (see pipeline_prefetch)
Definition: Http1Server.cc:237
virtual void start()
called by AsyncStart; do not call directly
Definition: Http1Server.cc:41
StatusCode
Definition: StatusCode.h:20
Definition: forward.h:21
virtual void noteBodyConsumerAborted(BodyPipe::Pointer)
Definition: Http1Server.cc:296
virtual time_t idleTimeout() const
timeout to use when waiting for the next request
Definition: Http1Server.cc:35
virtual void noteTakeServerConnectionControl(ServerConnectionContext)
Definition: Http1Server.cc:385
err_type
Definition: err_type.h:12
HttpRequestMethod method_
parsed HTTP method
Definition: Http1Server.h:62
const bool isHttpsServer
temporary hack to avoid creating a true HttpsServer class
Definition: Http1Server.h:65
virtual ~Server()
Definition: Http1Server.h:26
virtual void handleReply(HttpReply *rep, StoreIOBuffer receivedData)
Definition: Http1Server.cc:303
virtual void processParsedRequest(Http::StreamPointer &context)
start processing a freshly parsed request
Definition: Http1Server.cc:248
bool buildHttpRequest(Http::StreamPointer &context)
Definition: Http1Server.cc:98
size_t HttpReply *STUB StoreEntry const KeyScope scope const HttpRequestMethod & method
Definition: stub_store.cc:108
Http1::RequestParserPointer parser_
Definition: Http1Server.h:61
void processHttpRequest(Http::Stream *const context)
Manages a connection from an HTTP/1 or HTTP/0.9 client.
Definition: Http1Server.h:20
struct _request * request(char *urlin)
Definition: tcp-banger2.c:291
void proceedAfterBodyContinuation(Http::StreamPointer context)
Definition: Http1Server.cc:230
virtual void noteMoreBodySpaceAvailable(BodyPipe::Pointer)
Definition: Http1Server.cc:60

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors