소스 검색

Use CURLOPT_PROTOCOLS_STR on newer curls;

bjorn 1 년 전
부모
커밋
4a40d1c43a
1개의 변경된 파일4개의 추가작업 그리고 0개의 파일을 삭제
  1. 4 0
      http.c

+ 4 - 0
http.c

@@ -553,7 +553,11 @@ static bool http_request(http_request_t* request, http_response_t* response) {
   CURL* handle = curl.easy_init();
   CURL* handle = curl.easy_init();
   if (!handle) return response->error = "curl unavailable", false;
   if (!handle) return response->error = "curl unavailable", false;
 
 
+#if LIBCURL_VERSION_NUM >= 0x075500
+  curl.easy_setopt(handle, CURLOPT_PROTOCOLS_STR, "http,https");
+#else
   curl.easy_setopt(handle, CURLOPT_PROTOCOLS, CURLPROTO_HTTP | CURLPROTO_HTTPS);
   curl.easy_setopt(handle, CURLOPT_PROTOCOLS, CURLPROTO_HTTP | CURLPROTO_HTTPS);
+#endif
   curl.easy_setopt(handle, CURLOPT_URL, request->url);
   curl.easy_setopt(handle, CURLOPT_URL, request->url);
 
 
   if (request->method) {
   if (request->method) {