cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Unsupported setsockopt level:->this warning means

From: BLANC Gilles <gblanc_at_linagora.com>
Date: Mon, 22 Sep 2008 10:35:43 +0200

On Wednesday 17 September 2008 06:24:34 Sachin Gole, you wrote :
> Platform is
>
> Ubuntu 7.10 - the Gutsy Gibbon - released in October 2007.
>
> Previously, it works without any warning.
>
> When i have started using curllibrary in my program, it started giving
> warnings.
>
> ---------------------------------------------------------------------------
>--------------------------------------------
>
> i tried to download one file on terminal,
>
> desktop:~$ curl "http://mt1.google.com/mt?x=92&y=200&zoom=8" -o "file1"
>
> file is downloaded but with following warning.
>
> can anybody know what this waring is
>
> ---------------------------------------------------------------------------
>-----
>
> Unsupported setsockopt level=1 optname=9
> Warning: Could not set SO_KEEPALIVE!
> ---------------------------------------------------------------------------

    Hi,

I'm the guy who wrote the code for SO_KEEPALIVE support, and also this
warning. All the story is explained on this ML b/w 12/05/07 and 12/12/07
(subject is "FTP keep alive connection", be careful, the thread is on
curl-library and curl-users ML) :
http://curl.haxx.se/mail/archive-2007-12/0020.html
(and also : http://curl.haxx.se/mail/lib-2007-11/0043.html )

In a nutshell, SO_KEEPALIVE should always be supported (though it is not
really absolutely always the case, that's why it only prints a warning and
continue without it if setsockopt fails, but it's very rare), it simply
assures you that your TCP connection is always up when it doesn't send any
command for a long time, but still transfers data (for example, a big FTP
transfer). Some firewalls are very nasty about ressource allocation, and can
cut connections on that cases : this option solves the problem (better than
sending NOOP with a sleep loop !).

You can find it on main.c, function sockoptcallback (it has moved since last
December) :
http://cool.haxx.se/cvs.cgi/curl/src/main.c?rev=1.487&content-type=text/vnd.viewcvs-markup

As already said, "--no-keepalive" disable the feature with curl.

It's weird that a Ubuntu has problem with it... Does it warn you every time ?
(maybe it's a server problem)

-- 
Gilles Blanc - gblanc_at_linagora.com
Ingénieur informatique embarquée
Groupe LINAGORA - http://www.linagora.com
Tél.: +33(0)1 58 18 68 28 - Fax : +33(0)1 58 18 68 29
-------------------------------------------------------------------
List admin: http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-users
FAQ:        http://curl.haxx.se/docs/faq.html
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2008-09-22