Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Merge branch 'v0.6'

  • Loading branch information...
piscisaureus committed Apr 5, 2012
2 parents f09f7bc + 3506cd1 commit f6df47b474b428d3535c935739c957cc8e7c00f8
Showing with 4 additions and 6 deletions.
  1. +1 −2 src/win/tcp.c
  2. +3 −4 src/win/udp.c
@@ -252,10 +252,9 @@ static int uv__bind(uv_tcp_t* handle,
int addrsize) {
DWORD err;
int r;
SOCKET sock;

if (handle->socket == INVALID_SOCKET) {
sock = socket(domain, SOCK_STREAM, 0);
SOCKET sock = socket(domain, SOCK_STREAM, 0);
if (sock == INVALID_SOCKET) {
uv__set_sys_error(handle->loop, WSAGetLastError());
return -1;
@@ -163,7 +163,6 @@ static int uv__bind(uv_udp_t* handle,
int addrsize,
unsigned int flags) {
int r;
SOCKET sock;
DWORD no = 0, yes = 1;

if ((flags & UV_UDP_IPV6ONLY) && domain != AF_INET6) {
@@ -173,7 +172,7 @@ static int uv__bind(uv_udp_t* handle,
}

if (handle->socket == INVALID_SOCKET) {
sock = socket(domain, SOCK_DGRAM, 0);
SOCKET sock = socket(domain, SOCK_DGRAM, 0);
if (sock == INVALID_SOCKET) {
uv__set_sys_error(handle->loop, WSAGetLastError());
return -1;
@@ -192,14 +191,14 @@ static int uv__bind(uv_udp_t* handle,
/* TODO: how to handle errors? This may fail if there is no ipv4 stack */
/* available, or when run on XP/2003 which have no support for dualstack */
/* sockets. For now we're silently ignoring the error. */
setsockopt(sock,
setsockopt(handle->socket,
IPPROTO_IPV6,
IPV6_V6ONLY,
(char*) &no,
sizeof no);
}

r = setsockopt(sock,
r = setsockopt(handle->socket,
SOL_SOCKET,
SO_REUSEADDR,
(char*) &yes,

0 comments on commit f6df47b

Please sign in to comment.
You can’t perform that action at this time.