Changeset 3350
- Timestamp:
- 02/01/10 15:42:38 (6 weeks ago)
- Location:
- plugins/branches/0185_GEN_PHYSICS_REFACTOR_2/ZBoostNetworking
- Files:
-
- 13 modified
-
XML/I_XMLResponse.hpp (modified) (1 diff)
-
src/HTTP/Message.cpp (modified) (1 diff)
-
src/HTTP/Message.hpp (modified) (1 diff)
-
src/HTTP/Reply.cpp (modified) (1 diff)
-
src/HTTP/Reply.hpp (modified) (3 diffs)
-
src/HTTP/Request.cpp (modified) (1 diff)
-
src/HTTP/Request.hpp (modified) (2 diffs)
-
src/XML/I_XMLResponse.cpp (modified) (1 diff)
-
src/XML/Message.cpp (modified) (1 diff)
-
src/XML/Message.hpp (modified) (1 diff)
-
src/XML/Reply.cpp (modified) (3 diffs)
-
src/XML/Reply.hpp (modified) (4 diffs)
-
src/XML/Request.hpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
plugins/branches/0185_GEN_PHYSICS_REFACTOR_2/ZBoostNetworking/XML/I_XMLResponse.hpp
r1236 r3350 75 75 /// @{ 76 76 public: 77 static pResponse_type createResponse(pEndpoint_type _pDestinationEndpoint, StatusType _status, const std::string& _body, const std::string& _contentType = "text/html"); 77 static pResponse_type createResponse(pEndpoint_type _pDestinationEndpoint, 78 StatusType _status, const std::string& _body, 79 unsigned int _requestMessageId, 80 const std::string& _contentType = "text/html"); 78 81 /// @} 79 82 -
plugins/branches/0185_GEN_PHYSICS_REFACTOR_2/ZBoostNetworking/src/HTTP/Message.cpp
r1086 r3350 82 82 83 83 //-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ 84 unsigned int 85 Message::getMessageId() const 86 { 87 static Zen::Threading::SpinLock sm_spinLock; 88 static unsigned int sm_lastId = 0; 89 90 Zen::Threading::xCriticalSection lock(sm_spinLock); 91 return ++sm_lastId; 92 } 93 94 //-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ 84 95 } // namespace HTTP 85 96 } // namespace AppServer -
plugins/branches/0185_GEN_PHYSICS_REFACTOR_2/ZBoostNetworking/src/HTTP/Message.hpp
r1086 r3350 43 43 virtual pEndpoint_type getDestinationEndpoint(); 44 44 virtual pResourceLocation_type getDestinationLocation(); 45 virtual unsigned int getMessageId() const; 45 46 virtual void serialize(boost::archive::polymorphic_iarchive& _archive, const int _version); 46 47 virtual void serialize(boost::archive::polymorphic_oarchive& _archive, const int _version); -
plugins/branches/0185_GEN_PHYSICS_REFACTOR_2/ZBoostNetworking/src/HTTP/Reply.cpp
r1494 r3350 261 261 } 262 262 263 //-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ 264 unsigned int 265 Reply::getMessageId() const 266 { 267 // This really shouldn't be used for HTTP messages. 268 return 0; 269 } 270 271 //-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ 272 unsigned int 273 Reply::getRequestMessageId() const 274 { 275 // This really shouldn't be used for HTTP messages. 276 return 0; 277 } 263 278 //-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ 264 279 void -
plugins/branches/0185_GEN_PHYSICS_REFACTOR_2/ZBoostNetworking/src/HTTP/Reply.hpp
r3332 r3350 2 2 // Zen Enterprise Framework 3 3 // 4 // Copyright (C) 2001 - 20 09Tony Richards4 // Copyright (C) 2001 - 2010 Tony Richards 5 5 // 6 6 // This software is provided 'as-is', without any express or implied … … 63 63 virtual pResourceLocation_type getDestinationLocation(); 64 64 virtual pMessageHeader_type getMessageHeader() const; 65 virtual unsigned int getMessageId() const; 65 66 virtual void serialize(pMessageHeader_type _pHeader, boost::archive::polymorphic_iarchive& _archive, const int _version); 66 67 virtual void serialize(boost::archive::polymorphic_oarchive& _archive, const int _version); … … 89 90 /// @{ 90 91 public: 91 Reply(pEndpoint_type _pDestinationEndpoint, StatusType _status, const std::string& _body, const std::string& _contentType); 92 Reply(pEndpoint_type _pDestinationEndpoint, StatusType _status, const std::string& _body, 93 const std::string& _contentType); 92 94 Reply(); 93 95 virtual ~Reply(); -
plugins/branches/0185_GEN_PHYSICS_REFACTOR_2/ZBoostNetworking/src/HTTP/Request.cpp
r1494 r3350 2 2 // Zen Enterprise Framework 3 3 // 4 // Copyright (C) 2001 - 20 09Tony Richards4 // Copyright (C) 2001 - 2010 Tony Richards 5 5 // 6 6 // This software is provided 'as-is', without any express or implied -
plugins/branches/0185_GEN_PHYSICS_REFACTOR_2/ZBoostNetworking/src/HTTP/Request.hpp
r1494 r3350 2 2 // Zen Enterprise Framework 3 3 // 4 // Copyright (C) 2001 - 20 09Tony Richards4 // Copyright (C) 2001 - 2010 Tony Richards 5 5 // 6 6 // This software is provided 'as-is', without any express or implied … … 56 56 virtual pResourceLocation_type getDestinationLocation() { return Message::getDestinationLocation(); } 57 57 virtual pMessageHeader_type getMessageHeader() const; 58 virtual unsigned int getMessageId() const { return Message::getMessageId(); } 58 59 virtual void serialize(pMessageHeader_type _pHeader, boost::archive::polymorphic_iarchive& _archive, const int _version); 59 60 virtual void serialize(boost::archive::polymorphic_oarchive& _archive, const int _version); -
plugins/branches/0185_GEN_PHYSICS_REFACTOR_2/ZBoostNetworking/src/XML/I_XMLResponse.cpp
r1236 r3350 68 68 //-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ 69 69 I_XMLResponse::pResponse_type 70 I_XMLResponse::createResponse(pEndpoint_type _pDestinationEndpoint, StatusType _status, const std::string& _body, const std::string& _contentType) 70 I_XMLResponse::createResponse(pEndpoint_type _pDestinationEndpoint, StatusType _status, 71 const std::string& _body, unsigned int _requestMessageId, 72 const std::string& _contentType) 71 73 { 72 Reply* pReply = new XML::Reply(_pDestinationEndpoint, _status, _body, _contentType );74 Reply* pReply = new XML::Reply(_pDestinationEndpoint, _status, _body, _contentType, _requestMessageId); 73 75 74 76 pResponse_type pResponse(pReply, destroyResponse); -
plugins/branches/0185_GEN_PHYSICS_REFACTOR_2/ZBoostNetworking/src/XML/Message.cpp
r1237 r3350 84 84 85 85 //-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ 86 unsigned int 87 Message::getMessageId() const 88 { 89 static Zen::Threading::SpinLock sm_spinLock; 90 static unsigned int sm_lastId = 0; 91 92 Zen::Threading::xCriticalSection lock(sm_spinLock); 93 return ++sm_lastId; 94 } 95 96 //-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ 86 97 } // namespace XML 87 98 } // namespace AppServer -
plugins/branches/0185_GEN_PHYSICS_REFACTOR_2/ZBoostNetworking/src/XML/Message.hpp
r1237 r3350 45 45 virtual pEndpoint_type getDestinationEndpoint(); 46 46 virtual pResourceLocation_type getDestinationLocation(); 47 virtual unsigned int getMessageId() const; 47 48 virtual void serialize(boost::archive::polymorphic_iarchive& _archive, const int _version); 48 49 virtual void serialize(boost::archive::polymorphic_oarchive& _archive, const int _version); -
plugins/branches/0185_GEN_PHYSICS_REFACTOR_2/ZBoostNetworking/src/XML/Reply.cpp
r1494 r3350 102 102 103 103 //-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ 104 Reply::Reply(pEndpoint_type _pDestinationEndpoint, StatusType _status, const std::string& _body, const std::string& _contentType) 104 Reply::Reply(pEndpoint_type _pDestinationEndpoint, StatusType _status, 105 const std::string& _body, const std::string& _contentType, 106 unsigned int _requestMessageId) 105 107 : m_pDestinationEndpoint(_pDestinationEndpoint) 106 108 , m_content(_body) 109 , m_requestMessageId(_requestMessageId) 107 110 { 108 111 m_status = _status; … … 118 121 //-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ 119 122 Reply::Reply() 123 : m_requestMessageId(0) 120 124 { 121 125 } … … 153 157 { 154 158 throw Utility::runtime_exception("Reply::getMessageHeader(): Error, not implemented."); 159 } 160 161 //-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ 162 unsigned int 163 Reply::getMessageId() const 164 { 165 static Zen::Threading::SpinLock sm_spinLock; 166 static unsigned int sm_lastId = 0; 167 168 Zen::Threading::xCriticalSection lock(sm_spinLock); 169 return ++sm_lastId; 170 } 171 172 //-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ 173 unsigned int 174 Reply::getRequestMessageId() const 175 { 176 return m_requestMessageId; 155 177 } 156 178 -
plugins/branches/0185_GEN_PHYSICS_REFACTOR_2/ZBoostNetworking/src/XML/Reply.hpp
r1494 r3350 2 2 // Zen Enterprise Framework 3 3 // 4 // Copyright (C) 2001 - 20 09Tony Richards4 // Copyright (C) 2001 - 2010 Tony Richards 5 5 // Copyright (C) 2008 - 2009 Matthew Alan Gray 6 6 // … … 65 65 virtual pResourceLocation_type getDestinationLocation(); 66 66 virtual pMessageHeader_type getMessageHeader() const; 67 virtual unsigned int getMessageId() const; 67 68 virtual void serialize(pMessageHeader_type _pHeader, boost::archive::polymorphic_iarchive& _archive, const int _version); 68 69 virtual void serialize(boost::archive::polymorphic_oarchive& _archive, const int _version); 70 /// @} 71 72 /// @name I_Response implementation 73 /// @{ 74 public: 75 virtual unsigned int getRequestMessageId() const; 69 76 /// @} 70 77 … … 85 92 /// @{ 86 93 public: 87 Reply(pEndpoint_type _pDestinationEndpoint, StatusType _status, const std::string& _body, const std::string& _contentType); 94 Reply(pEndpoint_type _pDestinationEndpoint, StatusType _status, 95 const std::string& _body, const std::string& _contentType, 96 unsigned int _requestMessageId); 88 97 Reply(); 89 98 virtual ~Reply(); … … 98 107 99 108 pEndpoint_type m_pDestinationEndpoint; 109 unsigned int m_requestMessageId; 100 110 101 111 //Buffers_type m_buffers; -
plugins/branches/0185_GEN_PHYSICS_REFACTOR_2/ZBoostNetworking/src/XML/Request.hpp
r1494 r3350 2 2 // Zen Enterprise Framework 3 3 // 4 // Copyright (C) 2001 - 20 09Tony Richards4 // Copyright (C) 2001 - 2010 Tony Richards 5 5 // Copyright (C) 2008 - 2009 Matthew Alan Gray 6 6 // … … 58 58 virtual pResourceLocation_type getDestinationLocation() { return Message::getDestinationLocation(); } 59 59 virtual pMessageHeader_type getMessageHeader() const; 60 virtual unsigned int getMessageId() const { return Message::getMessageId(); } 60 61 virtual void serialize(pMessageHeader_type _pHeader, boost::archive::polymorphic_iarchive& _archive, const int _version); 61 62 virtual void serialize(boost::archive::polymorphic_oarchive& _archive, const int _version);
