From 7137d2b9395dc051e2adbe0c83553479646cedb1 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 17 Apr 2016 12:44:57 +0000 Subject: - unused netlib flags removed git-svn-id: http://svn.miranda-ng.org/main/trunk@16689 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/mir_app/src/netlibhttp.cpp | 22 +++++++--------------- src/mir_app/src/netlibhttpproxy.cpp | 2 +- src/mir_app/src/netlibopenconn.cpp | 2 +- 3 files changed, 9 insertions(+), 17 deletions(-) (limited to 'src/mir_app') diff --git a/src/mir_app/src/netlibhttp.cpp b/src/mir_app/src/netlibhttp.cpp index bd8069457a..8429ef512c 100644 --- a/src/mir_app/src/netlibhttp.cpp +++ b/src/mir_app/src/netlibhttp.cpp @@ -436,7 +436,7 @@ INT_PTR NetlibHttpSendRequest(WPARAM wParam, LPARAM lParam) if (!pszUrl) { pszUrl = pszFullUrl; - if (nlhr->flags & (NLHRF_SMARTREMOVEHOST | NLHRF_REMOVEHOST | NLHRF_GENERATEHOST)) { + if (!(nlhr->flags & NLHRF_MANUALHOST)) { bool usingProxy = nlc->proxyType == PROXYTYPE_HTTP && !(nlhr->flags & NLHRF_SSL); mir_free(szHost); @@ -450,14 +450,11 @@ INT_PTR NetlibHttpSendRequest(WPARAM wParam, LPARAM lParam) if (ppath == phost) phost = NULL; - if (nlhr->flags & NLHRF_GENERATEHOST) { - szHost = mir_strdup(phost); - if (ppath && phost) - szHost[ppath - phost] = 0; - } + szHost = mir_strdup(phost); + if (ppath && phost) + szHost[ppath - phost] = 0; - if (nlhr->flags & NLHRF_REMOVEHOST || (nlhr->flags & NLHRF_SMARTREMOVEHOST && !usingProxy)) - pszUrl = ppath ? ppath : "/"; + pszUrl = ppath ? ppath : "/"; if (usingProxy && phost && !nlc->dnsThroughProxy) { char *tszHost = mir_strdup(phost); @@ -848,21 +845,16 @@ INT_PTR NetlibHttpTransaction(WPARAM wParam, LPARAM lParam) if (nlc == NULL) return 0; - NETLIBHTTPREQUEST nlhrSend; - char szUserAgent[64]; - - nlhrSend = *nlhr; - nlhrSend.flags &= ~NLHRF_REMOVEHOST; - nlhrSend.flags |= NLHRF_GENERATEHOST | NLHRF_SMARTREMOVEHOST | NLHRF_SMARTAUTHHEADER; + NETLIBHTTPREQUEST nlhrSend = *nlhr; bool doneUserAgentHeader = NetlibHttpFindHeader(nlhr, "User-Agent") != NULL; bool doneAcceptEncoding = NetlibHttpFindHeader(nlhr, "Accept-Encoding") != NULL; - if (!doneUserAgentHeader || !doneAcceptEncoding) { nlhrSend.headers = (NETLIBHTTPHEADER*)mir_alloc(sizeof(NETLIBHTTPHEADER) * (nlhrSend.headersCount + 2)); memcpy(nlhrSend.headers, nlhr->headers, sizeof(NETLIBHTTPHEADER) * nlhr->headersCount); } + char szUserAgent[64]; if (!doneUserAgentHeader) { nlhrSend.headers[nlhrSend.headersCount].szName = "User-Agent"; nlhrSend.headers[nlhrSend.headersCount].szValue = szUserAgent; diff --git a/src/mir_app/src/netlibhttpproxy.cpp b/src/mir_app/src/netlibhttpproxy.cpp index 2de8379dfe..f5216d1b38 100644 --- a/src/mir_app/src/netlibhttpproxy.cpp +++ b/src/mir_app/src/netlibhttpproxy.cpp @@ -72,7 +72,7 @@ static bool NetlibHttpGatewaySend(NetlibConnection *nlc, RequestType reqType, co nlhrSend.pData = (char*)buf; nlhrSend.dataLength = len; - nlhrSend.flags = NLHRF_GENERATEHOST | NLHRF_DUMPPROXY | NLHRF_SMARTAUTHHEADER | NLHRF_NOPROXY | NLHRF_REDIRECT; + nlhrSend.flags = NLHRF_DUMPPROXY | NLHRF_NOPROXY | NLHRF_REDIRECT; if (nlc->nlhpi.flags & NLHPIF_HTTP11) nlhrSend.flags |= NLHRF_HTTP11; diff --git a/src/mir_app/src/netlibopenconn.cpp b/src/mir_app/src/netlibopenconn.cpp index 3f9406594e..f6586e6494 100644 --- a/src/mir_app/src/netlibopenconn.cpp +++ b/src/mir_app/src/netlibopenconn.cpp @@ -300,7 +300,7 @@ static bool NetlibInitHttpsConnection(NetlibConnection *nlc, NetlibUser *nlu, NE nlhrSend.cbSize = sizeof(nlhrSend); nlhrSend.requestType = REQUEST_CONNECT; - nlhrSend.flags = NLHRF_GENERATEHOST | NLHRF_DUMPPROXY | NLHRF_SMARTAUTHHEADER | NLHRF_HTTP11 | NLHRF_NOPROXY | NLHRF_REDIRECT; + nlhrSend.flags = NLHRF_DUMPPROXY | NLHRF_HTTP11 | NLHRF_NOPROXY | NLHRF_REDIRECT; if (nlc->dnsThroughProxy) mir_snprintf(szUrl, "%s:%u", nloc->szHost, nloc->wPort); else { -- cgit v1.2.3