c = nc;
if(bufsize) {
- utcp_set_sndbuf(c, bufsize);
- utcp_set_rcvbuf(c, bufsize);
+ utcp_set_sndbuf(c, NULL, bufsize);
+ utcp_set_rcvbuf(c, NULL, bufsize);
}
utcp_set_accept_cb(c->utcp, NULL, NULL);
getsockopt(s, IPPROTO_IP, IP_MTU, &mtu, &optlen);
}
+#else
+ (void)s;
#endif
if(!mtu || mtu == 65535) {
return 1;
}
} else {
+#ifdef SO_NOSIGPIPE
+ int nosigpipe = 1;
+ setsockopt(s, SOL_SOCKET, SO_NOSIGPIPE, &nosigpipe, sizeof(nosigpipe));
+#endif
+
if(connect(s, ai->ai_addr, ai->ai_addrlen)) {
debug("Could not connect: %s\n", strerror(errno));
return 1;
c = utcp_connect_ex(u, 1, do_recv, NULL, flags);
if(bufsize) {
- utcp_set_sndbuf(c, bufsize);
- utcp_set_rcvbuf(c, bufsize);
+ utcp_set_sndbuf(c, NULL, bufsize);
+ utcp_set_rcvbuf(c, NULL, bufsize);
}
}