diff --git a/oio-win.c b/oio-win.c index f0b38509..5462a1d3 100644 --- a/oio-win.c +++ b/oio-win.c @@ -596,7 +596,7 @@ void oio_queue_read(oio_handle* handle) { DWORD bytes, flags; assert(handle->flags & OIO_HANDLE_READING); - + req = &handle->read_accept_req; assert(!(req->flags & OIO_REQ_PENDING)); memset(&req->overlapped, 0, sizeof(req->overlapped)); @@ -632,7 +632,7 @@ int oio_listen(oio_handle* handle, int backlog, oio_accept_cb cb) { return -1; } - if (handle->flags & OIO_HANDLE_LISTENING || + if (handle->flags & OIO_HANDLE_LISTENING || handle->flags & OIO_HANDLE_READING) { /* Already listening. */ oio_set_sys_error(WSAEALREADY); @@ -648,7 +648,7 @@ int oio_listen(oio_handle* handle, int backlog, oio_accept_cb cb) { handle->accept_cb = cb; oio_queue_accept(handle); - + return 0; } @@ -679,7 +679,7 @@ int oio_accept(oio_handle* server, oio_handle* client, int oio_read_start(oio_handle* handle, oio_read_cb cb) { - if (handle->flags & OIO_HANDLE_LISTENING || + if (handle->flags & OIO_HANDLE_LISTENING || handle->flags & OIO_HANDLE_READING) { /* Already listening. */ oio_set_sys_error(WSAEALREADY); @@ -919,12 +919,12 @@ static void oio_poll() { buf = oio_alloc_(handle, 65536); assert(buf.len > 0); flags = 0; - if (WSARecv(handle->socket, - (WSABUF*)&buf, - 1, - &bytes, - &flags, - NULL, + if (WSARecv(handle->socket, + (WSABUF*)&buf, + 1, + &bytes, + &flags, + NULL, NULL) != SOCKET_ERROR) { if (bytes > 0) { /* Successful read */ diff --git a/test/echo-server.c b/test/echo-server.c index faeae681..07d3bc5e 100644 --- a/test/echo-server.c +++ b/test/echo-server.c @@ -50,7 +50,7 @@ void after_write(oio_req* req, int status) { } wr = (write_req_t*) req; - + /* Free the read/write buffer and the request */ free(wr->buf.base); free(wr); @@ -59,18 +59,18 @@ void after_write(oio_req* req, int status) { void after_read(oio_handle* handle, int nread, oio_buf buf) { write_req_t *wr; - + if (nread < 0) { /* Error or EOF */ ASSERT (oio_last_error().code == OIO_EOF); - + if (buf.base) { free(buf.base); } oio_close(handle); return; - } + } if (nread == 0) { /* Everything OK, but nothing read. */ diff --git a/test/test-delayed-accept.c b/test/test-delayed-accept.c index 7aa9a834..af5945f4 100644 --- a/test/test-delayed-accept.c +++ b/test/test-delayed-accept.c @@ -111,7 +111,7 @@ static void read_cb(oio_handle* handle, int nread, oio_buf buf) { if (buf.base) { free(buf.base); } - + oio_close(handle); } diff --git a/test/test-tcp-writealot.c b/test/test-tcp-writealot.c index 354973ed..03eb3217 100644 --- a/test/test-tcp-writealot.c +++ b/test/test-tcp-writealot.c @@ -56,7 +56,7 @@ static void close_cb(oio_handle* handle, int status) { static void read_cb(oio_handle* handle, int nread, oio_buf buf) { ASSERT(handle != NULL); - + if (nread < 0) { ASSERT(oio_last_error().code == OIO_EOF);