Misc. cleanups
This commit is contained in:
parent
3ee60b7351
commit
fbd2d7a194
@ -363,8 +363,6 @@ HELPER_IMPL(pump_server) {
|
|||||||
|
|
||||||
|
|
||||||
void pump(int n) {
|
void pump(int n) {
|
||||||
int r;
|
|
||||||
|
|
||||||
ASSERT(n <= MAX_WRITE_HANDLES);
|
ASSERT(n <= MAX_WRITE_HANDLES);
|
||||||
TARGET_CONNECTIONS = n;
|
TARGET_CONNECTIONS = n;
|
||||||
|
|
||||||
|
|||||||
9
uv-win.c
9
uv-win.c
@ -770,7 +770,7 @@ static void uv_queue_accept(uv_tcp_t* handle) {
|
|||||||
|
|
||||||
|
|
||||||
static void uv_queue_read(uv_tcp_t* handle) {
|
static void uv_queue_read(uv_tcp_t* handle) {
|
||||||
uv_req_t *req;
|
uv_req_t* req;
|
||||||
uv_buf_t buf;
|
uv_buf_t buf;
|
||||||
int result;
|
int result;
|
||||||
DWORD bytes, flags;
|
DWORD bytes, flags;
|
||||||
@ -844,7 +844,6 @@ int uv_accept(uv_tcp_t* server, uv_tcp_t* client,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (uv_tcp_init_socket(client, close_cb, data, server->accept_socket) == -1) {
|
if (uv_tcp_init_socket(client, close_cb, data, server->accept_socket) == -1) {
|
||||||
uv_fatal_error(uv_last_error_.sys_errno_, "init");
|
|
||||||
closesocket(server->accept_socket);
|
closesocket(server->accept_socket);
|
||||||
rv = -1;
|
rv = -1;
|
||||||
}
|
}
|
||||||
@ -984,17 +983,17 @@ int uv_write(uv_req_t* req, uv_buf_t bufs[], int bufcnt) {
|
|||||||
if (result != 0) {
|
if (result != 0) {
|
||||||
err = WSAGetLastError();
|
err = WSAGetLastError();
|
||||||
if (err != WSA_IO_PENDING) {
|
if (err != WSA_IO_PENDING) {
|
||||||
/* Send faild due to an error */
|
/* Send failed due to an error. */
|
||||||
uv_set_sys_error(WSAGetLastError());
|
uv_set_sys_error(WSAGetLastError());
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (result == 0) {
|
if (result == 0) {
|
||||||
/* Request completed immediately */
|
/* Request completed immediately. */
|
||||||
req->queued_bytes = 0;
|
req->queued_bytes = 0;
|
||||||
} else {
|
} else {
|
||||||
/* Request queued by the kernel */
|
/* Request queued by the kernel. */
|
||||||
req->queued_bytes = uv_count_bufs(bufs, bufcnt);
|
req->queued_bytes = uv_count_bufs(bufs, bufcnt);
|
||||||
handle->write_queue_size += req->queued_bytes;
|
handle->write_queue_size += req->queued_bytes;
|
||||||
}
|
}
|
||||||
|
|||||||
6
uv-win.h
6
uv-win.h
@ -59,12 +59,12 @@ typedef struct uv_buf_t {
|
|||||||
uv_req_t* shutdown_req;
|
uv_req_t* shutdown_req;
|
||||||
|
|
||||||
#define uv_tcp_server_fields \
|
#define uv_tcp_server_fields \
|
||||||
void *connection_cb; \
|
void *connection_cb; \
|
||||||
SOCKET accept_socket; \
|
SOCKET accept_socket; \
|
||||||
struct uv_req_s accept_req; \
|
struct uv_req_s accept_req; \
|
||||||
char accept_buffer[sizeof(struct sockaddr_storage) * 2 + 32];
|
char accept_buffer[sizeof(struct sockaddr_storage) * 2 + 32];
|
||||||
|
|
||||||
#define UV_TCP_PRIVATE_FIELDS \
|
#define UV_TCP_PRIVATE_FIELDS \
|
||||||
unsigned int reqs_pending; \
|
unsigned int reqs_pending; \
|
||||||
union { \
|
union { \
|
||||||
SOCKET socket; \
|
SOCKET socket; \
|
||||||
@ -104,7 +104,7 @@ typedef struct uv_buf_t {
|
|||||||
uv_handle_t* endgame_next; \
|
uv_handle_t* endgame_next; \
|
||||||
unsigned int flags; \
|
unsigned int flags; \
|
||||||
uv_err_t error; \
|
uv_err_t error; \
|
||||||
UV_LOOP_PRIVATE_FIELDS
|
UV_LOOP_PRIVATE_FIELDS
|
||||||
|
|
||||||
|
|
||||||
int uv_utf16_to_utf8(wchar_t* utf16Buffer, size_t utf16Size, char* utf8Buffer, size_t utf8Size);
|
int uv_utf16_to_utf8(wchar_t* utf16Buffer, size_t utf16Size, char* utf8Buffer, size_t utf8Size);
|
||||||
|
|||||||
2
uv.h
2
uv.h
@ -311,7 +311,7 @@ int uv_timer_start(uv_timer_t* timer, uv_loop_cb cb, int64_t timeout, int64_t re
|
|||||||
int uv_timer_stop(uv_timer_t* timer);
|
int uv_timer_stop(uv_timer_t* timer);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Stop the timer, and if it is repeating restart it using the repeat value
|
* Stop the timer, and if it is repeating restart it using the repeat value
|
||||||
* as the timeout. If the timer has never been started before it returns -1 and
|
* as the timeout. If the timer has never been started before it returns -1 and
|
||||||
* sets the error to UV_EINVAL.
|
* sets the error to UV_EINVAL.
|
||||||
*/
|
*/
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user