handle better situation when no data read
This commit is contained in:
parent
36dece23b7
commit
1e5a421107
|
|
@ -66,7 +66,12 @@ std::pair<int, std::string> HttpClient::doGetRequest(const std::string &url, con
|
|||
|
||||
std::string request = "GET " + full_url + " HTTP/1.0\r\nHost: " + server + headers_string + "\r\n\r\n";
|
||||
|
||||
// TODO memory leaks ???
|
||||
int bytes_read = sslRequest(server, request);
|
||||
if (bytes_read <= 0) {
|
||||
std::cerr << "no data read" << std::endl;
|
||||
return std::make_pair(403, "");
|
||||
}
|
||||
|
||||
std::string::size_type position = ssl_read_packet.find("\r\n\r\n");
|
||||
if (position == std::string::npos) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue