tr_port port,
bool clientIsSeed UNUSED)
{
- struct sockaddr_storage ss;
- socklen_t sslen;
-
- if (!tr_address_is_valid_for_peers (addr, port))
- return -EINVAL;
+ struct UTPSocket * ret = NULL;
- sslen = setup_sockaddr (addr, port, &ss);
+ 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);
+ }
- return UTP_Create (tr_utpSendTo, (void*)session,
- (struct sockaddr*)&ss, sslen);
+ return ret;
}
static int