2 +----------------------------------------------------------------------+
4 +----------------------------------------------------------------------+
5 | Copyright (c) 2010-present Facebook, Inc. (http://www.facebook.com) |
6 +----------------------------------------------------------------------+
7 | This source file is subject to version 3.01 of the PHP license, |
8 | that is bundled with this package in the file LICENSE, and is |
9 | available through the world-wide-web at the following url: |
10 | http://www.php.net/license/3_01.txt |
11 | If you did not receive a copy of the PHP license and are unable to |
12 | obtain it through the world-wide-web, please send a note to |
13 | license@php.net so we can mail you a copy immediately. |
14 +----------------------------------------------------------------------+
17 #ifndef incl_HPHP_HTTP_PROTOCOL_H_
18 #define incl_HPHP_HTTP_PROTOCOL_H_
20 #include "hphp/runtime/server/transport.h"
23 ///////////////////////////////////////////////////////////////////////////////
27 struct SourceRootInfo
;
33 static const VirtualHost
*GetVirtualHost(Transport
*transport
);
34 static void PrepareSystemVariables(Transport
*transport
,
36 const SourceRootInfo
&sri
);
37 static void PrepareRequestVariables(Array
& request
,
41 const std::string
& requestOrder
);
42 static void PrepareGetVariable(Array
& get
,
44 static void PreparePostVariables(Array
& post
,
49 static bool PrepareCookieVariable(Array
& cookie
,
50 Transport
*transport
);
51 static void PrepareServerVariable(Array
& server
,
54 const SourceRootInfo
&sri
,
55 const VirtualHost
*vhost
);
57 static bool ProxyRequest(Transport
*transport
, bool force
,
58 const std::string
&url
, int &code
,
59 std::string
&error
, StringBuffer
&response
,
60 HeaderMap
*extraHeaders
= nullptr);
62 static std::string
RecordRequest(Transport
*transport
);
63 static void ClearRecord(bool success
, const std::string
&tmpfile
);
65 static void DecodeParameters(Array
& variables
,
69 static void DecodeRfc1867(Transport
* transport
,
75 std::string boundary
);
76 static void DecodeCookies(Array
& variables
, char *data
);
77 static bool IsRfc1867(std::string contentType
, std::string
&boundary
);
79 static const char *GetReasonString(int code
);
82 ///////////////////////////////////////////////////////////////////////////////
85 #endif // incl_HPHP_HTTP_PROTOCOL_H_