[Top][All Lists]

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

Re: [Bug-wget] [PATCH] timeout option is ingnored if host does not answe

From: Tim Rühsen
Subject: Re: [Bug-wget] [PATCH] timeout option is ingnored if host does not answer SSL handshake (openssl)
Date: Thu, 11 Jul 2013 23:16:47 +0200
User-agent: KMail/1.13.7 (Linux/3.9-1-amd64; KDE/4.8.4; x86_64; ; )

Am Donnerstag, 11. Juli 2013 schrieb Giuseppe Scrivano:
> Tim Rühsen <address@hidden> writes:
> > diff --git a/src/gnutls.c b/src/gnutls.c
> > index 54422fc..a3b4ecc 100644
> > --- a/src/gnutls.c
> > +++ b/src/gnutls.c
> >    do
> >      {
> >        err = gnutls_handshake (session);
> > -      if (err < 0)
> > +
> > +      if (opt.connect_timeout && err == GNUTLS_E_AGAIN)
> > +        {
> > +          if (gnutls_record_get_direction (session))
> > +            {
> > +              /* wait for writeability */
> > +              err = select_fd (fd, opt.connect_timeout, WAIT_FOR_WRITE);
> > +            }
> > +          else
> > +            {
> > +              /* wait for readability */
> > +              err = select_fd (fd, opt.connect_timeout, WAIT_FOR_READ);
> since this is in a loop, should we also decrement the time we wait for
> at each iteration?  We do something similar in wgnutls_read_timeout.

I saw it, but took the routine from 'Mget' (It is my code, so I can contribute 
to Wget). This was a matter of time I had and I knew that it works.
The idea is to define 'connect_timeout' as the time nothing happens while 
But please feel free to change it to work as in wgnutls_read_timeout().

BTW, maybe Wget should have something like Curls -m (a total/maximum timeout). 
I need such a thing in several projects (where I use Curl instead of Wget 
because of this reason).

> I have fixed some indentation problems and also I had some troubles to
> apply your patch with "git am" so I had to apply the changes
> separately.  Could you please use the version I have attached?

I locally revert my commit and pull it in from master.

To explain my repeated indentation problems:
The IDE I am working with (Netbeans) doesn't allow project-based indentation 
style. Since i always have several dozen project open, almost all of them 
having 'Linux' style, I have to hand-remove the tabs and replace them by 
spaces (in each line). Pretty awful, especially because the 'artifical 
intelligence' screws in from time to time. I really can't write larger Gnu 
code, just some fixes or hacks (though I would like to, but my poor nerves...).

Does Eclipse do it any better ?

Regards, Tim

Attachment: signature.asc
Description: This is a digitally signed message part.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]