Commit e548ded2 authored by jan.koester's avatar jan.koester
Browse files

test

parent 2ffef594
Loading
Loading
Loading
Loading
+9 −16
Changes for src/http.cpp: 9 added lines, 16 removed lines.
Original line number Diff line number Diff line
@@ -208,9 +208,9 @@ libhttppp::HttpClient::HttpClient(const HttpUrl& desturl)
    try {
        netplus::x509cert cert;
        if (_url.getProtocol() == HttpUrl::HTTPS) {
            _cltsock = std::make_unique<netplus::ssl>(cert);
            _cltsock = std::make_unique<netplus::ssl>(cert,-1);
        } else {
            _cltsock = std::make_unique<netplus::tcp>();
            _cltsock = std::make_unique<netplus::tcp>(-1);
        }

        _cltsock->connect(_url.getHost(), _url.getPort(), false);
@@ -1766,19 +1766,6 @@ void libhttppp::HttpRequest::send(const HttpUrl &dest,

    netplus::x509cert cert;

    // ---------------------------------------------------------
    // 0) Create socket
    // ---------------------------------------------------------
    if (dest.getProtocol() == HttpUrl::HTTPS) {
        sock = std::make_unique<netplus::ssl>(cert);
    } else {
        sock = std::make_unique<netplus::tcp>();
    }

    // optional: für blocking retry loops hilfreich
    // (setzt je nach impl. SO_RCVTIMEO/SO_SNDTIMEO)
    // sock->setTimeout(5000);

    // ---------------------------------------------------------
    // helper: connect (nonblock) + handshake + flush progress
    // ---------------------------------------------------------
@@ -1788,7 +1775,13 @@ void libhttppp::HttpRequest::send(const HttpUrl &dest,
        //    entweder erfolgreich returnen oder Note werfen.
        for (;;) {
            try {
                sock->connect(dest.getHost(), dest.getPort(), true);
                if (!sock || sock->fd() < 0) {
                    if (dest.getProtocol() == HttpUrl::HTTPS) {
                        sock = std::make_unique<netplus::ssl>(cert);
                    } else {
                        sock = std::make_unique<netplus::tcp>();
                    }
                }
                break; // connected
            } catch (netplus::NetException &e) {
                if (e.getErrorType() == netplus::NetException::Note) {