Re: [RFC PATCH] Add WEBDAV timeout to http-fetch.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Sean <seanlkml@xxxxxxxxxxxx> writes:

> If a server is having problems delivering the Git repo over WEBDAV,
> timeout after two minutes so that a regular http transfer can
> be tried.
>
> ---
>
>  http-fetch.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
>
> Not sure if this is the correct fix, but it should improve the situation
> for cloning and fetching from servers like Takis's.  When connecting to
> his server WEBDAV doesn't respond after the initial connection.  Nothing
> proceeds until the OS connection times out many minutes later.
>
> This patch sets the CURL timeout to two minutes so that things proceed
> sooner.  Even with this patch it takes two extra minutes of "dead time"
> to complete all operations; obivously this still sucks.
>
> However, I don't know if the two minute timeout is long enough for
> all cases with a server where WEBDAV is functioning properly.
> Hopefully someone who knows more about Curl can comment and perhaps
> offer another solution.
>
> Maybe the real solution is just to figure out and fix whatever is
> going on with the WEBDAV server and forget this patch.

I think it is prudent to protect the client from a broken server
and it is independent from "fixing" the server side.  It would
perhaps make sense to make this overridable somehow but I am not
sure how -- .git/config is too global (the problem would be per
remote site), and having the user to set environment variable
only when going to specific server is too cumbersome to be
useful.  This ideally should be a per-remote configuration
item.

> diff --git a/http-fetch.c b/http-fetch.c
> index bc74f30..046245a 100644
> --- a/http-fetch.c
> +++ b/http-fetch.c
> @@ -861,6 +861,7 @@ static int remote_ls(struct alt_base *re
>  	curl_easy_setopt(slot->curl, CURLOPT_UPLOAD, 1);
>  	curl_easy_setopt(slot->curl, CURLOPT_CUSTOMREQUEST, DAV_PROPFIND);
>  	curl_easy_setopt(slot->curl, CURLOPT_HTTPHEADER, dav_headers);
> +	curl_easy_setopt(slot->curl, CURLOPT_TIMEOUT, 120);
>  
>  	if (start_active_slot(slot)) {
>  		run_active_slot(slot);
> -- 
> 1.4.2.3.gabd697


-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]