2 +----------------------------------------------------------------------+
4 +----------------------------------------------------------------------+
5 | Copyright (c) 2010-2013 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_RPC_REQUEST_HANDLER_H_
18 #define incl_HPHP_RPC_REQUEST_HANDLER_H_
20 #include "hphp/runtime/server/server.h"
21 #include "hphp/runtime/base/execution_context.h"
28 DECLARE_BOOST_TYPES(SatelliteServerInfo
);
29 ///////////////////////////////////////////////////////////////////////////////
31 class RPCRequestHandler
: public RequestHandler
{
33 enum class ReturnEncodeType
{
38 RPCRequestHandler(int timeout
, bool info
);
39 virtual ~RPCRequestHandler();
41 void setServerInfo(SatelliteServerInfoPtr info
) { m_serverInfo
= info
;}
43 // implementing RequestHandler
44 virtual void handleRequest(Transport
*transport
);
47 * Force a reset before the next request.
49 void setReset() { m_reset
= true; }
51 time_t getLastResetTime() const { return m_lastReset
; }
53 void setReturnEncodeType(ReturnEncodeType et
) { m_returnEncodeType
= et
; }
54 ReturnEncodeType
getReturnEncodeType() const { return m_returnEncodeType
; }
56 ExecutionContext
*m_context
;
57 SatelliteServerInfoPtr m_serverInfo
;
58 int m_requestsSinceReset
;
61 ReturnEncodeType m_returnEncodeType
;
66 bool needReset() const;
67 bool executePHPFunction(Transport
*transport
,
68 SourceRootInfo
&sourceRootInfo
,
69 ReturnEncodeType returnEncodeType
);
71 std::string
getSourceFilename(const std::string
&path
,
72 SourceRootInfo
&sourceRootInfo
);
75 ///////////////////////////////////////////////////////////////////////////////
78 #endif // incl_HPHP_RPC_REQUEST_HANDLER_H_