File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed
Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change 1515#include "vector.h"
1616#include "proxy.h"
1717
18+ /* This is for backwards compatibility with curl<7.45.0. */
19+ #ifndef CURLINFO_ACTIVESOCKET
20+ # define CURLINFO_ACTIVESOCKET CURLINFO_LASTSOCKET
21+ # define GIT_CURL_BADSOCKET -1
22+ # define git_activesocket_t long
23+ #else
24+ # define GIT_CURL_BADSOCKET CURL_SOCKET_BAD
25+ # define git_activesocket_t curl_socket_t
26+ #endif
27+
1828typedef struct {
1929 git_stream parent ;
2030 CURL * handle ;
@@ -87,7 +97,8 @@ static int ask_and_apply_proxy_creds(curl_stream *s)
8797static int curls_connect (git_stream * stream )
8898{
8999 curl_stream * s = (curl_stream * ) stream ;
90- long sockextr , connect_last = 0 ;
100+ git_activesocket_t sockextr ;
101+ long connect_last = 0 ;
91102 int failed_cert = 0 , error ;
92103 bool retry_connect ;
93104 CURLcode res ;
@@ -117,11 +128,11 @@ static int curls_connect(git_stream *stream)
117128 if (res == CURLE_PEER_FAILED_VERIFICATION )
118129 failed_cert = 1 ;
119130
120- if ((res = curl_easy_getinfo (s -> handle , CURLINFO_LASTSOCKET , & sockextr )) != CURLE_OK ) {
131+ if ((res = curl_easy_getinfo (s -> handle , CURLINFO_ACTIVESOCKET , & sockextr )) != CURLE_OK ) {
121132 return seterr_curl (s );
122133 }
123134
124- if (sockextr == -1 ) {
135+ if (sockextr == GIT_CURL_BADSOCKET ) {
125136 giterr_set (GITERR_NET , "curl socket is no longer valid" );
126137 return -1 ;
127138 }
You can’t perform that action at this time.
0 commit comments