openbsd-ports/net/libnice/patches/patch-stun_usages_bind_c
jasper 98f2972252 - get some more regress tests running
from upstream via tom murphy (maintainer)
2009-09-09 22:13:08 +00:00

30 lines
844 B
Plaintext

$OpenBSD: patch-stun_usages_bind_c,v 1.1 2009/09/09 22:13:08 jasper Exp $
--- stun/usages/bind.c.orig Wed Sep 9 16:20:06 2009
+++ stun/usages/bind.c Wed Sep 9 16:23:43 2009
@@ -263,16 +263,20 @@ stun_trans_create (StunTransport *tr, int type, int pr
if (fd == -1)
return STUN_USAGE_TRANS_RETURN_ERROR;
- if (connect (fd, srv, srvlen) &&
+ if (type != SOCK_DGRAM) {
+ if (connect (fd, srv, srvlen) &&
#ifdef _WIN32
- (WSAGetLastError () != WSAEINPROGRESS)) {
+ (WSAGetLastError () != WSAEINPROGRESS)) {
#else
- (errno != EINPROGRESS)) {
+ (errno != EINPROGRESS)) {
#endif
- goto error;
+ goto error;
+ }
+ val = stun_trans_init (tr, fd, NULL, 0);
+ } else {
+ val = stun_trans_init (tr, fd, srv, srvlen);
}
- val = stun_trans_init (tr, fd, NULL, 0);
if (val)
goto error;