You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Karl Fogel <kf...@newton.ch.collab.net> on 2002/10/25 19:49:21 UTC

Re: svn commit: rev 3499 - trunk/subversion/include trunk/subversion/libsvn_subr trunk/subversion/libsvn_ra_dav

philip@tigris.org writes:
> Make the neon timeout adjustable by making it part of the proxy
> configuration.

Great.  I guess let's just leave it in there for now; but if we start
shoehorning more non-proxy stuff into that file, we can reconsider
changing the file's name.

-K


> * subversion/libsvn_ra_dav/session.c
>   (get_proxy_and_timeout): Renamed from get_proxy. Now gets timeout value
>   as well.
>   (svn_ra_dav__open): Set neon timeout.
> 
> * subversion/libsvn_subr/config_file.c (svn_config_ensure): Add timeout
>   to initial config file text.
> 
> * subversion/include/svn_error_codes.h (SVN_ERR_RA_DAV_INVALID_TIMEOUT): New
>   error.
> 
> 
> Modified: trunk/subversion/include/svn_error_codes.h
> ==============================================================================
> --- trunk/subversion/include/svn_error_codes.h	(original)
> +++ trunk/subversion/include/svn_error_codes.h	Fri Oct 25 14:07:41 2002
> @@ -525,6 +525,10 @@
>                SVN_ERR_RA_DAV_CATEGORY_START + 5,
>                "RA layer file already exists")
>  
> +  SVN_ERRDEF (SVN_ERR_RA_DAV_INVALID_TIMEOUT,
> +              SVN_ERR_RA_DAV_CATEGORY_START + 6,
> +              "invalid timeout")
> +
>    /* ra_local errors */
>    
>    SVN_ERRDEF (SVN_ERR_RA_LOCAL_REPOS_NOT_FOUND,
> 
> Modified: trunk/subversion/libsvn_subr/config_file.c
> ==============================================================================
> --- trunk/subversion/libsvn_subr/config_file.c	(original)
> +++ trunk/subversion/libsvn_subr/config_file.c	Fri Oct 25 14:07:42 2002
> @@ -642,7 +642,8 @@
>        apr_file_t *f;
>        const char *contents =
>          "### This file determines which proxy servers to use, if\n"
> -        "### any, when contacting a remote repository.\n"
> +        "### any, when contacting a remote repository and the duration\n"
> +        "### of the timeout waiting for a response from the server.\n"
>          "###\n"
>          "### The commented-out examples below are intended only to\n"
>          "### demonstrate how to use this file; any resemblance to\n"
> @@ -653,6 +654,8 @@
>          "### trying to access is matched against the patterns on\n"
>          "### the right.  If a match is found, the proxy info is\n"
>          "### taken from the section with the corresponding name.\n"
> +        "### Timeouts, if given, are specified in seconds.  A timeout\n"
> +        "### of 0, i.e. zero, causes a builtin default to be used.\n"
>          "# [groups]\n"
>          "# group1 = *.collab.net\n"
>          "# othergroup = repository.blarggitywhoomph.com\n"
> @@ -663,6 +666,7 @@
>          "# port = 80\n"
>          "# username = blah\n"
>          "# password = doubleblah\n"
> +        "# timeout = 60\n"
>          "\n"
>          "### Information for the second group:\n"
>          "# [othergroup]\n"
> @@ -686,7 +690,8 @@
>          "# host = defaultproxy.whatever.com\n"
>          "# port = 7000\n"
>          "# username = defaultusername\n"
> -        "# password = defaultpassword\n";
> +        "# password = defaultpassword\n"
> +        "# No timeout, so just use the builtin default.\n";
>  
>        apr_err = apr_file_open (&f, path,
>                                 (APR_WRITE | APR_CREATE | APR_EXCL),
> 
> Modified: trunk/subversion/libsvn_ra_dav/session.c
> ==============================================================================
> --- trunk/subversion/libsvn_ra_dav/session.c	(original)
> +++ trunk/subversion/libsvn_ra_dav/session.c	Fri Oct 25 14:07:42 2002
> @@ -188,26 +188,25 @@
>      return TRUE;
>  }
>  
> -
> -/* Set *PROXY_HOST, *PROXY_PORT, *PROXY_USERNAME, and *PROXY_PASSWORD
> - * to the proxy information for REQUESTED_HOST, allocated in POOL, if
> - * there is any applicable information.  If there is no applicable
> - * information or if there is an error, then set *PROXY_PORT to
> - * (unsigned int) -1 and the rest to NULL.  This function can return
> - * an error, so before checking *PROXY_*, check for error return
> - * value.
> +/* Set *PROXY_HOST, *PROXY_PORT, *PROXY_USERNAME, *PROXY_PASSWORD and
> + * *TIMEOUT_SECONDS to the proxy information for REQUESTED_HOST, allocated
> + * in POOL, if there is any applicable information.  If there is no
> + * applicable information or if there is an error, then set *PROXY_PORT to
> + * (unsigned int) -1 and the rest to NULL.  This function can return an
> + * error, so before checking *PROXY_*, check for error return value.
>   */
> -static svn_error_t *get_proxy(const char **proxy_host,
> -                              unsigned int *proxy_port,
> -                              const char **proxy_username,
> -                              const char **proxy_password,
> -                              const char *requested_host,
> -                              apr_pool_t *pool)
> +static svn_error_t *get_proxy_and_timeout(const char **proxy_host,
> +                                          unsigned int *proxy_port,
> +                                          const char **proxy_username,
> +                                          const char **proxy_password,
> +                                          int *timeout_seconds,
> +                                          const char *requested_host,
> +                                          apr_pool_t *pool)
>  {
>    struct search_groups_baton gb;
>    svn_config_t *cfg;
>    const char *exceptions;
> -  const char *port_str;
> +  const char *port_str, *timeout_str;
>  
>    /* If we find nothing, default to nulls. */
>    *proxy_host     = NULL;
> @@ -215,6 +214,7 @@
>    *proxy_username = NULL;
>    *proxy_password = NULL;
>    port_str        = NULL;
> +  timeout_str     = NULL;
>  
>    SVN_ERR( svn_config_read_proxies(&cfg, pool) );
>  
> @@ -227,6 +227,7 @@
>        svn_config_get(cfg, &port_str, "default", "port", NULL);
>        svn_config_get(cfg, proxy_username, "default", "username", NULL);
>        svn_config_get(cfg, proxy_password, "default", "password", NULL);
> +      svn_config_get(cfg, &timeout_str, "default", "timeout", NULL);
>      }
>  
>    /* Search for a proxy pattern specific to this host. */
> @@ -243,6 +244,7 @@
>                       *proxy_username);
>        svn_config_get(cfg, proxy_password, gb.proxy_group, "password",
>                       *proxy_password);
> +      svn_config_get(cfg, &timeout_str, gb.proxy_group, "timeout", timeout_str);
>      }
>  
>    /* Special case: convert the port value, if any. */
> @@ -266,6 +268,22 @@
>    else
>      *proxy_port = 80;
>  
> +  if (timeout_str)
> +    {
> +      char *endstr;
> +      const long int timeout = strtol(timeout_str, &endstr, 10);
> +
> +      if (*endstr)
> +        return svn_error_create(SVN_ERR_RA_DAV_INVALID_TIMEOUT, 0, NULL, pool,
> +                                "illegal character in timeout value");
> +      if (timeout < 0)
> +        return svn_error_create(SVN_ERR_RA_DAV_INVALID_TIMEOUT, 0, NULL, pool,
> +                                "negative timeout value");
> +      *timeout_seconds = timeout;
> +    }
> +  else
> +    *timeout_seconds = 0;
> +
>    return SVN_NO_ERROR;
>  }
>  
> @@ -391,20 +409,22 @@
>    sess = ne_session_create(uri.scheme, uri.host, uri.port);
>    sess2 = ne_session_create(uri.scheme, uri.host, uri.port);
>  
> -  /* If there's a proxy for this URL, use it. */
> +  /* If there's a timeout or proxy for this URL, use it. */
>    {
>      const char *proxy_host;
>      unsigned int proxy_port;
>      const char *proxy_username;
>      const char *proxy_password;
> +    int timeout;
>      svn_error_t *err;
>      
> -    err = get_proxy(&proxy_host,
> -                    &proxy_port,
> -                    &proxy_username,
> -                    &proxy_password,
> -                    uri.host,
> -                    pool);
> +    err = get_proxy_and_timeout(&proxy_host,
> +                                &proxy_port,
> +                                &proxy_username,
> +                                &proxy_password,
> +                                &timeout,
> +                                uri.host,
> +                                pool);
>      if (err)
>        {
>          ne_uri_free(&uri);
> @@ -428,6 +448,12 @@
>              ne_set_proxy_auth(sess, proxy_auth, pab);
>              ne_set_proxy_auth(sess2, proxy_auth, pab);
>            }
> +      }
> +
> +    if (timeout)
> +      {
> +        ne_set_read_timeout(sess, timeout);
> +        ne_set_read_timeout(sess2, timeout);
>        }
>    }
>  
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: svn-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: svn-help@subversion.tigris.org

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn commit: rev 3499 - trunk/subversion/include trunk/subversion/libsvn_subr trunk/subversion/libsvn_ra_dav

Posted by Philip Martin <ph...@codematters.co.uk>.
Branko Čibej <br...@xbc.nu> writes:

> > or how to change the Windows stuff,
> >
> What Windows stuff is there to change?

Some of the SVN_REGISTRY_ stuff in libsvn_subr/config_impl?  I have
only vague notions of what it does.

> > but it's very useful to be able to change the timeout
> >as it's about the only workaround for the large directory problem
> >
> I don't think so. We should be able to stream out the dirprops report,
> I don't think we have to construct the whole thing before sending back
> the first byte.

This is obviously the long-term solution, but increasing the timeout
helps users today!  I did said workaround...

> >(short of getting faster hardware :)  If one cannot checkout, then one
> >cannot really do anything else.

-- 
Philip Martin

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn commit: rev 3499 - trunk/subversion/include trunk/subversion/libsvn_subr trunk/subversion/libsvn_ra_dav

Posted by Branko Čibej <br...@xbc.nu>.
Philip Martin wrote:

>Karl Fogel <kf...@newton.ch.collab.net> writes:
>
>  
>
>>philip@tigris.org writes:
>>    
>>
>>>Make the neon timeout adjustable by making it part of the proxy
>>>configuration.
>>>      
>>>
>>Great.  I guess let's just leave it in there for now; but if we start
>>shoehorning more non-proxy stuff into that file, we can reconsider
>>changing the file's name.
>>    
>>
>
>Yes.  I wasn't really sure what to call the file,
>
~/,subversion/servers? It contains information about accessing remote 
servers.

> or how to change the Windows stuff,
>
What Windows stuff is there to change?

> but it's very useful to be able to change the timeout
>as it's about the only workaround for the large directory problem
>
I don't think so. We should be able to stream out the dirprops report, I 
don't think we have to construct the whole thing before sending back the 
first byte.

>(short of getting faster hardware :)  If one cannot checkout, then one
>cannot really do anything else.
>

-- 
Brane Čibej   <br...@xbc.nu>   http://www.xbc.nu/brane/


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn commit: rev 3499 - trunk/subversion/include trunk/subversion/libsvn_subr trunk/subversion/libsvn_ra_dav

Posted by Philip Martin <ph...@codematters.co.uk>.
Karl Fogel <kf...@newton.ch.collab.net> writes:

> philip@tigris.org writes:
> > Make the neon timeout adjustable by making it part of the proxy
> > configuration.
> 
> Great.  I guess let's just leave it in there for now; but if we start
> shoehorning more non-proxy stuff into that file, we can reconsider
> changing the file's name.

Yes.  I wasn't really sure what to call the file, or how to change the
Windows stuff, but it's very useful to be able to change the timeout
as it's about the only workaround for the large directory problem
(short of getting faster hardware :)  If one cannot checkout, then one
cannot really do anything else.

-- 
Philip Martin

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org