From: Daniel Stenberg Date: Wed, 8 Jan 2014 22:37:27 +0000 (+0100) Subject: Curl_updateconninfo: don't do anything for UDP "connections" X-Git-Tag: curl-7_35_0~84 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=28933f9d304657ab8341380d00f9ecbe86cb9e6f;p=curl Curl_updateconninfo: don't do anything for UDP "connections" getpeername() doesn't work for UDP sockets since they're not connected Reported-by: Priyanka Shah Bug: http://curl.haxx.se/mail/archive-2014-01/0016.html --- diff --git a/lib/connect.c b/lib/connect.c index 05666ebb6..f04cce7e3 100644 --- a/lib/connect.c +++ b/lib/connect.c @@ -657,6 +657,10 @@ void Curl_updateconninfo(struct connectdata *conn, curl_socket_t sockfd) struct Curl_sockaddr_storage ssloc; struct SessionHandle *data = conn->data; + if(conn->socktype == SOCK_DGRAM) + /* there's no connection! */ + return; + if(!conn->bits.reuse) { len = sizeof(struct Curl_sockaddr_storage);