Misc. cleanups
This commit is contained in:
parent
3ee60b7351
commit
fbd2d7a194
@ -363,8 +363,6 @@ HELPER_IMPL(pump_server) {
|
||||
|
||||
|
||||
void pump(int n) {
|
||||
int r;
|
||||
|
||||
ASSERT(n <= MAX_WRITE_HANDLES);
|
||||
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) {
|
||||
uv_req_t *req;
|
||||
uv_req_t* req;
|
||||
uv_buf_t buf;
|
||||
int result;
|
||||
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) {
|
||||
uv_fatal_error(uv_last_error_.sys_errno_, "init");
|
||||
closesocket(server->accept_socket);
|
||||
rv = -1;
|
||||
}
|
||||
@ -984,17 +983,17 @@ int uv_write(uv_req_t* req, uv_buf_t bufs[], int bufcnt) {
|
||||
if (result != 0) {
|
||||
err = WSAGetLastError();
|
||||
if (err != WSA_IO_PENDING) {
|
||||
/* Send faild due to an error */
|
||||
/* Send failed due to an error. */
|
||||
uv_set_sys_error(WSAGetLastError());
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
if (result == 0) {
|
||||
/* Request completed immediately */
|
||||
/* Request completed immediately. */
|
||||
req->queued_bytes = 0;
|
||||
} else {
|
||||
/* Request queued by the kernel */
|
||||
/* Request queued by the kernel. */
|
||||
req->queued_bytes = uv_count_bufs(bufs, bufcnt);
|
||||
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;
|
||||
|
||||
#define uv_tcp_server_fields \
|
||||
void *connection_cb; \
|
||||
void *connection_cb; \
|
||||
SOCKET accept_socket; \
|
||||
struct uv_req_s accept_req; \
|
||||
char accept_buffer[sizeof(struct sockaddr_storage) * 2 + 32];
|
||||
|
||||
#define UV_TCP_PRIVATE_FIELDS \
|
||||
#define UV_TCP_PRIVATE_FIELDS \
|
||||
unsigned int reqs_pending; \
|
||||
union { \
|
||||
SOCKET socket; \
|
||||
@ -104,7 +104,7 @@ typedef struct uv_buf_t {
|
||||
uv_handle_t* endgame_next; \
|
||||
unsigned int flags; \
|
||||
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);
|
||||
|
||||
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);
|
||||
|
||||
/*
|
||||
* 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
|
||||
* sets the error to UV_EINVAL.
|
||||
*/
|
||||
|
||||
Loading…
Reference in New Issue
Block a user