Ver Fonte

fix https proxy

ithewei há 3 anos atrás
pai
commit
920c28be97
2 ficheiros alterados com 2 adições e 1 exclusões
  1. 1 0
      http/HttpMessage.h
  2. 1 1
      http/client/http_client.cpp

+ 1 - 0
http/HttpMessage.h

@@ -489,6 +489,7 @@ public:
     void FillHost(const char* host, int port = DEFAULT_HTTP_PORT);
     void SetHost(const char* host, int port = DEFAULT_HTTP_PORT);
     void SetProxy(const char* host, int port);
+    bool IsProxy() { return proxy; }
 
     // Range: bytes=0-4095
     void SetRange(long from = 0, long to = -1) {

+ 1 - 1
http/client/http_client.cpp

@@ -481,7 +481,7 @@ int __http_client_send(http_client_t* cli, HttpRequest* req, HttpResponse* resp)
     int err = 0;
     int timeout = req->timeout;
     int connfd = cli->fd;
-    bool https = req->IsHttps();
+    bool https = req->IsHttps() && !req->IsProxy();
     bool keepalive = true;
 
     time_t start_time = time(NULL);