cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: TCP_NODELAY

From: Joe Halpin <j.p.h_at_comcast.net>
Date: Sun, 21 Mar 2004 13:49:04 -0600

codemastr wrote:
> Think your patch is a bit backwards.
>>From MSDN:
> TCP_NODELAY - Disables the Nagle algorithm for send coalescing.
>
> So why does setting CURL_NAGLE turn TCP_NODELAY on? If Nagle is on, it means
> TCP_NODELAY isn't. Same for CURLOPT_NAGLE. Setting CURLOPT_NAGLE = 1 should
> not turn TCP_NODELAY on, it should turn it off. It seems confusing to me the
> way you have it now...

Well, since Nagle is enabled by default I was thinking of setting this
as a toggle which turned it off. But you have a good point. Looking at
it that way, it is confusing. I don't mind reversing the values.

> Also, I would guess this probably needs some #ifdef'ing. Is this something
> that every OS has? It seems to me putting it in a #ifdef TCP_NODELAY would
> probably be the safest bet.

I don't know about every OS, but it is POSIX, and works on the systems I
have here (Linux, FreeBSD and Solaris).

I looked at the autoconf docs again but couldn't find a test for
specific defines like this. If there is one I'd agree that we should use
it.

Joe
Received on 2004-03-21