Remove trailing whitespace
This commit is contained in:
parent
2b07bc34ce
commit
773b0dcf79
20
oio-win.c
20
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 */
|
||||
|
||||
@ -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. */
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
|
||||
@ -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);
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user