MCPcopy Create free account
hub / github.com/cuberite/cuberite / AwaitNextRequest

Method AwaitNextRequest

src/HTTPServer/HTTPConnection.cpp:95–128  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

93
94
95void cHTTPConnection::AwaitNextRequest(void)
96{
97 switch (m_State)
98 {
99 case wcsRecvHeaders:
100 {
101 // Nothing has been received yet, or a special response was given (SendStatusAndReason() or SendNeedAuth() )
102 break;
103 }
104
105 case wcsRecvIdle:
106 {
107 // The client is waiting for a response, send an "Internal server error":
108 m_OutgoingData.append("HTTP/1.1 500 Internal Server Error\r\n\r\n");
109 m_HTTPServer.NotifyConnectionWrite(*this);
110 m_State = wcsRecvHeaders;
111 break;
112 }
113
114 case wcsSendingResp:
115 {
116 // The response headers have been sent, we need to terminate the response body:
117 m_OutgoingData.append("0\r\n\r\n");
118 m_State = wcsRecvHeaders;
119 break;
120 }
121
122 default:
123 {
124 ASSERT(!"Unhandled state recovery");
125 break;
126 }
127 }
128}
129
130
131

Callers 1

RequestFinishedMethod · 0.80

Calls 1

NotifyConnectionWriteMethod · 0.80

Tested by

no test coverage detected