curl-library
Re: TFTP nits
Date: Mon, 5 Sep 2005 13:12:26 -0600 (GMT-06:00)
-----Original Message-----
From: Gisle Vanem <giva_at_bgnett.no>
...
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;
else
hints.ai_socktype = SOCK_STREAM;
in connect.c?
--gv
Gisle,
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.
-jk
Received on 2005-09-05