aboutsummaryrefslogtreecommitdiff
path: root/lib/url.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2005-09-16 21:30:08 +0000
committerDaniel Stenberg <daniel@haxx.se>2005-09-16 21:30:08 +0000
commite7093b3ca8f54a9d67a078ce37afdc825c86fdf4 (patch)
tree7eceb12a79f2c7f98f920768abc58e334873e6b5 /lib/url.c
parentd0a4104c0cb1c8b4c1e02ae314a1ad4831d37d4a (diff)
keep 'socktype' in the connectdata struct and make sure we use that for all
protocol sockets even if the resolved address may say otherwise
Diffstat (limited to 'lib/url.c')
-rw-r--r--lib/url.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/url.c b/lib/url.c
index c256cf23f..f84ee3734 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -2729,6 +2729,8 @@ static CURLcode CreateConnection(struct SessionHandle *data,
* Setup internals depending on protocol
*************************************************************/
+ conn->socktype = SOCK_STREAM; /* most of them are TCP streams */
+
if (strequal(conn->protostr, "HTTP")) {
#ifndef CURL_DISABLE_HTTP
conn->port = PORT_HTTP;
@@ -2927,12 +2929,13 @@ static CURLcode CreateConnection(struct SessionHandle *data,
else if (strequal(conn->protostr, "TFTP")) {
#ifndef CURL_DISABLE_TFTP
char *type;
+ conn->socktype = SOCK_DGRAM; /* UDP datagram based */
conn->protocol |= PROT_TFTP;
conn->port = PORT_TFTP;
conn->remote_port = PORT_TFTP;
conn->curl_connect = Curl_tftp_connect;
conn->curl_do = Curl_tftp;
- conn->curl_done = Curl_tftp_done;
+ conn->curl_done = Curl_tftp_done;
/* TFTP URLs support an extension like ";mode=<typecode>" that
* we'll try to get now! */
type=strstr(conn->path, ";mode=");