diff --git a/clib/sslclient.cpp b/clib/sslclient.cpp index bad6823..2f91eab 100644 --- a/clib/sslclient.cpp +++ b/clib/sslclient.cpp @@ -66,7 +66,12 @@ std::pair 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) {