cURL / Mailing Lists / curl-library / Single Mail


Re: TFTP nits

From: John Kelly <>
Date: Mon, 5 Sep 2005 13:12:26 -0600 (GMT-06:00)

-----Original Message-----
From: Gisle Vanem <>
Speaking of tftp nits; "curl tftp://localhost/foo" connects using
TCP contary to what host*.c is suggesting (using SOCK_DGRAM in
hints). Shouldn't there be a similar test to this one in hostip6.c:

 if(conn->protocol & PROT_TFTP)
   hints.ai_socktype = SOCK_DGRAM;
   hints.ai_socktype = SOCK_STREAM;

in connect.c?



There is code in lib/hostip6.c (line 256) that should take care of this. When I strace the commands on linux, I am seeing UDP sockets both under 2.4 and 2.6 kernels. There may be a better way to handle this--being not-so-familiar with the code, I was just looking to keep the switch as close to the socket() call as possible.

Received on 2005-09-05