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

Make uv_getsockname() operate on uv_handle_t handles.

  • Loading branch information...
bnoordhuis committed Aug 23, 2011
1 parent 5cae6e4 commit 52024061e4d4434cd47593bf6b1bf3c0411bd49f
Showing with 6 additions and 6 deletions.
  1. +1 −1 include/uv.h
  2. +1 −1 src/uv-unix.c
  3. +1 −1 src/win/tcp.c
  4. +3 −3 test/test-getsockname.c
@@ -415,7 +415,7 @@ struct uv_connect_s {
};


int uv_getsockname(uv_tcp_t* handle, struct sockaddr* name, int* namelen);
int uv_getsockname(uv_handle_t* handle, struct sockaddr* name, int* namelen);


/*
@@ -1116,7 +1116,7 @@ int uv_tcp_connect6(uv_connect_t* req,
}


int uv_getsockname(uv_tcp_t* handle, struct sockaddr* name, int* namelen) {
int uv_getsockname(uv_handle_t* handle, struct sockaddr* name, int* namelen) {
socklen_t socklen;
int saved_errno;

@@ -548,7 +548,7 @@ int uv_tcp_connect6(uv_connect_t* req, uv_tcp_t* handle,
}


int uv_getsockname(uv_tcp_t* handle, struct sockaddr* name, int* namelen) {
int uv_getsockname(uv_handle_t* handle, struct sockaddr* name, int* namelen) {
int result;

if (handle->flags & UV_HANDLE_SHUTTING) {
@@ -89,7 +89,7 @@ static void on_connection(uv_stream_t* server, int status) {
r = uv_accept(server, (uv_stream_t*)handle);
ASSERT(r == 0);

status = uv_getsockname((uv_tcp_t*)handle, &sockname, &namelen);
status = uv_getsockname(handle, &sockname, &namelen);
if (status != 0) {
fprintf(stderr, "uv_getsockname error (accepted) %d\n", uv_last_error().code);
}
@@ -110,7 +110,7 @@ static void on_connect(uv_connect_t* req, int status) {

ASSERT(status == 0);

r = uv_getsockname(&tcp, &sockname, &namelen);
r = uv_getsockname((uv_handle_t*)&tcp, &sockname, &namelen);
if (r != 0) {
fprintf(stderr, "uv_getsockname error (connector) %d\n", uv_last_error().code);
}
@@ -147,7 +147,7 @@ static int tcp_listener(int port) {
return 1;
}

r = uv_getsockname(&tcpServer, &sockname, &namelen);
r = uv_getsockname((uv_handle_t*)&tcpServer, &sockname, &namelen);
if (r != 0) {
fprintf(stderr, "uv_getsockname error (listening) %d\n", uv_last_error().code);
}

0 comments on commit 5202406

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