From 519feefcb420832cbf2f1aade2614069454f4c72 Mon Sep 17 00:00:00 2001 From: Jordan Lee Date: Thu, 6 Dec 2012 00:50:40 +0000 Subject: [PATCH] (trunk, libT) #5157 -- fix r13628 oops --- libtransmission/net.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/libtransmission/net.c b/libtransmission/net.c index d50e365ad..f68a35946 100644 --- a/libtransmission/net.c +++ b/libtransmission/net.c @@ -300,16 +300,16 @@ tr_netOpenPeerUTPSocket (tr_session * session, tr_port port, bool clientIsSeed UNUSED) { - struct sockaddr_storage ss; - socklen_t sslen; + struct UTPSocket * ret = NULL; - if (!tr_address_is_valid_for_peers (addr, port)) - return -EINVAL; + if (tr_address_is_valid_for_peers (addr, port)) + { + struct sockaddr_storage ss; + const socklen_t sslen = setup_sockaddr (addr, port, &ss); + ret = UTP_Create (tr_utpSendTo, session, (struct sockaddr*)&ss, sslen); + } - sslen = setup_sockaddr (addr, port, &ss); - - return UTP_Create (tr_utpSendTo, (void*)session, - (struct sockaddr*)&ss, sslen); + return ret; } static int