diff options
author | Rafal Nowosielski <rnowosielski@vistaprint.com> | 2014-07-24 04:15:24 +0200 |
---|---|---|
committer | Rafal Nowosielski <rafalnowosielski@me.com> | 2014-08-23 13:24:13 +0200 |
commit | 2db71194de87a83f1e504f9664dd3ca74fd0a6c4 (patch) | |
tree | 7edf67b1c4cb03cf95bb59d262917f22cfdf4f35 /src/transports | |
parent | d28b2b7a5ff608ce8f3da0e0b6a4c75afcf1e82c (diff) | |
download | libgit2-2db71194de87a83f1e504f9664dd3ca74fd0a6c4.tar.gz |
Set timeout on remote (WinHTTP) to infinite #2147
Diffstat (limited to 'src/transports')
-rw-r--r-- | src/transports/winhttp.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/transports/winhttp.c b/src/transports/winhttp.c index 1e46dfaee..b328988f1 100644 --- a/src/transports/winhttp.c +++ b/src/transports/winhttp.c @@ -212,6 +212,8 @@ static int winhttp_stream_connect(winhttp_stream *s) BOOL peerdist = FALSE; int error = -1; unsigned long disable_redirects = WINHTTP_DISABLE_REDIRECTS; + int default_timeout = -1; + /* Prepare URL */ git_buf_printf(&buf, "%s%s", t->connection_data.path, s->service_url); @@ -240,6 +242,8 @@ static int winhttp_stream_connect(winhttp_stream *s) goto on_error; } + WinHttpSetTimeouts(s->request, default_timeout, default_timeout, default_timeout, default_timeout); + /* Set proxy if necessary */ if (git_remote__get_http_proxy(t->owner->owner, !!t->connection_data.use_ssl, &proxy_url) < 0) goto on_error; @@ -467,6 +471,7 @@ static int winhttp_connect( int32_t port; const char *default_port = "80"; int error = -1; + int default_timeout = -1; /* Prepare port */ if (git__strtol32(&port, t->connection_data.port, NULL, 10) < 0) @@ -491,6 +496,9 @@ static int winhttp_connect( goto on_error; } + WinHttpSetTimeouts(t->session, default_timeout, default_timeout, default_timeout, default_timeout); + + /* Establish connection */ t->connection = WinHttpConnect( t->session, |