Loading src/http.cpp +23 −1 Original line number Diff line number Diff line Loading @@ -231,6 +231,7 @@ void libhttppp::HttpClient::resetConnection(){ } _cltsock->connect(_url.getHost(), _url.getPort(), false); _cltsock->setNonBlock(); // Check negotiated ALPN after TLS handshake if (auto *sslsock = dynamic_cast<netplus::ssl*>(_cltsock.get())) { Loading @@ -245,7 +246,20 @@ void libhttppp::HttpClient::resetConnection(){ void libhttppp::HttpClient::reconnect(){ _cltsock = std::make_unique<netplus::tcp>(); if(_url.getProtocol() == HttpUrl::HTTPS) { std::map<std::string, netplus::ssl::CertificateBundle> certs; auto sslsock = std::make_unique<netplus::ssl>(certs,-1); // Advertise h2 and http/1.1 via ALPN sslsock->getTls().client_alpn_protocols = std::string("\x02h2\x08http/1.1", 12); _cltsock = std::move(sslsock); } else { _cltsock = std::make_unique<netplus::tcp>(-1); } _cltsock->connect(_url.getHost().c_str(), _url.getPort()); _cltsock->setNonBlock(); } Loading Loading @@ -555,6 +569,10 @@ const std::vector<char> libhttppp::HttpClient::Get(libhttppp::HttpRequest &nreq) std::vector<char> ret; try { // Ensure a fresh connection for each request; keep-alive reuse // is unreliable without full connection-state tracking. resetConnection(); const int kMaxRedirects = 1; int redirects = 0; Loading Loading @@ -875,6 +893,10 @@ const std::vector<char> libhttppp::HttpClient::Post(libhttppp::HttpRequest &nreq std::vector<char> ret; try { // Ensure a fresh connection for each request; keep-alive reuse // is unreliable without full connection-state tracking. resetConnection(); const int kMaxRedirects = 1; int redirects = 0; Loading Loading
src/http.cpp +23 −1 Original line number Diff line number Diff line Loading @@ -231,6 +231,7 @@ void libhttppp::HttpClient::resetConnection(){ } _cltsock->connect(_url.getHost(), _url.getPort(), false); _cltsock->setNonBlock(); // Check negotiated ALPN after TLS handshake if (auto *sslsock = dynamic_cast<netplus::ssl*>(_cltsock.get())) { Loading @@ -245,7 +246,20 @@ void libhttppp::HttpClient::resetConnection(){ void libhttppp::HttpClient::reconnect(){ _cltsock = std::make_unique<netplus::tcp>(); if(_url.getProtocol() == HttpUrl::HTTPS) { std::map<std::string, netplus::ssl::CertificateBundle> certs; auto sslsock = std::make_unique<netplus::ssl>(certs,-1); // Advertise h2 and http/1.1 via ALPN sslsock->getTls().client_alpn_protocols = std::string("\x02h2\x08http/1.1", 12); _cltsock = std::move(sslsock); } else { _cltsock = std::make_unique<netplus::tcp>(-1); } _cltsock->connect(_url.getHost().c_str(), _url.getPort()); _cltsock->setNonBlock(); } Loading Loading @@ -555,6 +569,10 @@ const std::vector<char> libhttppp::HttpClient::Get(libhttppp::HttpRequest &nreq) std::vector<char> ret; try { // Ensure a fresh connection for each request; keep-alive reuse // is unreliable without full connection-state tracking. resetConnection(); const int kMaxRedirects = 1; int redirects = 0; Loading Loading @@ -875,6 +893,10 @@ const std::vector<char> libhttppp::HttpClient::Post(libhttppp::HttpRequest &nreq std::vector<char> ret; try { // Ensure a fresh connection for each request; keep-alive reuse // is unreliable without full connection-state tracking. resetConnection(); const int kMaxRedirects = 1; int redirects = 0; Loading