Skip to content
This repository has been archived by the owner on May 4, 2018. It is now read-only.

Commit

Permalink
unix: revert 98b9f58 and 431195c for now, corrupts memory
Browse files Browse the repository at this point in the history
  • Loading branch information
bnoordhuis committed Sep 9, 2011
1 parent e95a29e commit ca5346f
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 164 deletions.
2 changes: 0 additions & 2 deletions src/unix/core.c
Expand Up @@ -235,8 +235,6 @@ void uv__finish_close(uv_handle_t* handle) {
case UV_TCP:
assert(!ev_is_active(&((uv_stream_t*)handle)->read_watcher));
assert(!ev_is_active(&((uv_stream_t*)handle)->write_watcher));
assert(((uv_stream_t*)handle)->fd == -1);
uv__stream_destroy((uv_stream_t*)handle);
break;

case UV_UDP:
Expand Down
1 change: 0 additions & 1 deletion src/unix/internal.h
Expand Up @@ -81,7 +81,6 @@ void uv_fatal_error(const int errorno, const char* syscall);

/* stream */
int uv__stream_open(uv_stream_t*, int fd, int flags);
void uv__stream_destroy(uv_stream_t* stream);
void uv__stream_io(EV_P_ ev_io* watcher, int revents);
void uv__server_io(EV_P_ ev_io* watcher, int revents);
int uv__accept(int sockfd, struct sockaddr* saddr, socklen_t len);
Expand Down
29 changes: 0 additions & 29 deletions src/unix/stream.c
Expand Up @@ -75,35 +75,6 @@ int uv__stream_open(uv_stream_t* stream, int fd, int flags) {
}


/* Clears out the write queue, invokes the callbacks attached
* to each write request. Used when a stream is destroyed.
*/
static void uv__clear_queue(ngx_queue_t* wq, int status, uv_err_code code) {
uv_write_t* req;
ngx_queue_t* q;

while (!ngx_queue_empty(wq)) {
q = ngx_queue_head(wq);
ngx_queue_remove(q);

req = ngx_queue_data(q, uv_write_t, queue);
if (req->cb) {
uv_err_new(req->handle->loop, code);
req->cb(req, status);
}

if (req->bufs != req->bufsml)
free(req->bufs);
}
}


void uv__stream_destroy(uv_stream_t* stream) {
uv__clear_queue(&stream->write_queue, -1, UV_EINTR);
uv__clear_queue(&stream->write_completed_queue, 0, UV_OK);
}


void uv__server_io(EV_P_ ev_io* watcher, int revents) {
int fd;
struct sockaddr_storage addr;
Expand Down
2 changes: 0 additions & 2 deletions test/test-list.h
Expand Up @@ -31,7 +31,6 @@ TEST_DECLARE (tcp_bind_error_fault)
TEST_DECLARE (tcp_bind_error_inval)
TEST_DECLARE (tcp_bind_localhost_ok)
TEST_DECLARE (tcp_listen_without_bind)
TEST_DECLARE (tcp_close)
TEST_DECLARE (tcp_bind6_error_addrinuse)
TEST_DECLARE (tcp_bind6_error_addrnotavail)
TEST_DECLARE (tcp_bind6_error_fault)
Expand Down Expand Up @@ -118,7 +117,6 @@ TASK_LIST_START
TEST_ENTRY (tcp_bind_error_inval)
TEST_ENTRY (tcp_bind_localhost_ok)
TEST_ENTRY (tcp_listen_without_bind)
TEST_ENTRY (tcp_close)

TEST_ENTRY (tcp_bind6_error_addrinuse)
TEST_ENTRY (tcp_bind6_error_addrnotavail)
Expand Down
130 changes: 0 additions & 130 deletions test/test-tcp-close.c

This file was deleted.

0 comments on commit ca5346f

Please sign in to comment.