win: store the tcp deferred bind error in uv_tcp_t.bind_error, remove uv_handle_t.error

This commit is contained in:
Bert Belder 2011-08-23 20:33:26 +02:00
parent b931e93c3f
commit 811828719f
7 changed files with 5 additions and 10 deletions

View File

@ -58,7 +58,6 @@ typedef struct uv_buf_t {
size_t queued_bytes; \
}; \
}; \
uv_err_t error; \
struct uv_req_s* next_req;
#define UV_WRITE_PRIVATE_FIELDS \
@ -109,6 +108,7 @@ typedef struct uv_buf_t {
#define UV_TCP_PRIVATE_FIELDS \
SOCKET socket; \
uv_err_t bind_error; \
union { \
struct { uv_tcp_server_fields }; \
struct { uv_tcp_connection_fields }; \

View File

@ -78,7 +78,6 @@ int uv_async_init(uv_async_t* handle, uv_async_cb async_cb) {
handle->type = UV_ASYNC;
handle->flags = 0;
handle->async_sent = 0;
handle->error = uv_ok_;
handle->async_cb = async_cb;
req = &handle->async_req;

View File

@ -44,7 +44,6 @@ void uv_loop_watcher_endgame(uv_handle_t* handle) {
int uv_##name##_init(uv_##name##_t* handle) { \
handle->type = UV_##NAME; \
handle->flags = 0; \
handle->error = uv_ok_; \
\
uv_ref(); \
\

View File

@ -54,7 +54,6 @@ typedef struct env_var {
static void uv_process_init(uv_process_t* handle) {
handle->type = UV_PROCESS;
handle->flags = 0;
handle->error = uv_ok_;
handle->exit_cb = NULL;
handle->pid = 0;
handle->exit_signal = 0;

View File

@ -29,7 +29,6 @@
void uv_stream_init(uv_stream_t* handle) {
handle->write_queue_size = 0;
handle->flags = 0;
handle->error = uv_ok_;
uv_counters()->handle_init++;
uv_counters()->stream_init++;

View File

@ -174,7 +174,7 @@ static int uv__bind(uv_tcp_t* handle, int domain, struct sockaddr* addr, int add
err = WSAGetLastError();
if (err == WSAEADDRINUSE) {
/* Some errors are not to be reported until connect() or listen() */
handle->error = uv_new_sys_error(err);
handle->bind_error = uv_new_sys_error(err);
handle->flags |= UV_HANDLE_BIND_ERROR;
} else {
uv_set_sys_error(err);
@ -335,7 +335,7 @@ int uv_tcp_listen(uv_tcp_t* handle, int backlog, uv_connection_cb cb) {
assert(backlog > 0);
if (handle->flags & UV_HANDLE_BIND_ERROR) {
LOOP->last_error = handle->error;
LOOP->last_error = handle->bind_error;
return -1;
}
@ -452,7 +452,7 @@ int uv_tcp_connect(uv_connect_t* req, uv_tcp_t* handle,
DWORD bytes;
if (handle->flags & UV_HANDLE_BIND_ERROR) {
LOOP->last_error = handle->error;
LOOP->last_error = handle->bind_error;
return -1;
}
@ -507,7 +507,7 @@ int uv_tcp_connect6(uv_connect_t* req, uv_tcp_t* handle,
}
if (handle->flags & UV_HANDLE_BIND_ERROR) {
LOOP->last_error = handle->error;
LOOP->last_error = handle->bind_error;
return -1;
}

View File

@ -117,7 +117,6 @@ int uv_timer_init(uv_timer_t* handle) {
handle->type = UV_TIMER;
handle->flags = 0;
handle->error = uv_ok_;
handle->timer_cb = NULL;
handle->repeat = 0;