[WebIO] Handle status code
This commit is contained in:
parent
cce1ddc1df
commit
e92a2fe7ff
@ -294,7 +294,18 @@ namespace Utils
|
||||
finalHeaders.append("\r\n");
|
||||
}
|
||||
|
||||
HttpSendRequestA(WebIO::m_hFile, finalHeaders.data(), finalHeaders.size(), const_cast<char*>(body.data()), body.size() + 1);
|
||||
if (HttpSendRequestA(WebIO::m_hFile, finalHeaders.data(), finalHeaders.size(), const_cast<char*>(body.data()), body.size() + 1) == FALSE)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
DWORD statusCode = 404;
|
||||
DWORD length = sizeof(statusCode);
|
||||
if (HttpQueryInfo(WebIO::m_hFile, HTTP_QUERY_FLAG_NUMBER | HTTP_QUERY_STATUS_CODE, &statusCode, &length, NULL) == FALSE || (statusCode != 200 && statusCode != 201))
|
||||
{
|
||||
WebIO::CloseConnection();
|
||||
return "";
|
||||
}
|
||||
|
||||
std::string returnBuffer;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user