Fixed HTTP message parsing, prepared for SSL.
This commit is contained in:
parent
e1b6a16945
commit
a04cb6d146
@ -26,6 +26,7 @@ cHTTPConnection::cHTTPConnection(cHTTPServer & a_HTTPServer) :
|
|||||||
|
|
||||||
cHTTPConnection::~cHTTPConnection()
|
cHTTPConnection::~cHTTPConnection()
|
||||||
{
|
{
|
||||||
|
// LOGD("HTTP: Connection deleting: %p", this);
|
||||||
delete m_CurrentRequest;
|
delete m_CurrentRequest;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -183,11 +184,11 @@ void cHTTPConnection::DataReceived(const char * a_Data, size_t a_Size)
|
|||||||
// Process the rest of the incoming data into the request body:
|
// Process the rest of the incoming data into the request body:
|
||||||
if (a_Size > BytesConsumed)
|
if (a_Size > BytesConsumed)
|
||||||
{
|
{
|
||||||
DataReceived(a_Data + BytesConsumed, a_Size - BytesConsumed);
|
cHTTPConnection::DataReceived(a_Data + BytesConsumed, a_Size - BytesConsumed);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
DataReceived("", 0); // If the request has zero body length, let it be processed right-away
|
cHTTPConnection::DataReceived("", 0); // If the request has zero body length, let it be processed right-away
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -201,7 +201,7 @@ size_t cHTTPRequest::ParseRequestLine(const char * a_Data, size_t a_Size)
|
|||||||
return AString::npos;
|
return AString::npos;
|
||||||
}
|
}
|
||||||
// Check that there's HTTP/version at the end
|
// Check that there's HTTP/version at the end
|
||||||
if (strncmp(a_Data + URLEnd + 1, "HTTP/1.", 7) != 0)
|
if (strncmp(m_IncomingHeaderData.c_str() + URLEnd + 1, "HTTP/1.", 7) != 0)
|
||||||
{
|
{
|
||||||
m_IsValid = false;
|
m_IsValid = false;
|
||||||
return AString::npos;
|
return AString::npos;
|
||||||
|
Loading…
Reference in New Issue
Block a user