Skip to content
This repository has been archived by the owner on Nov 20, 2022. It is now read-only.

Commit

Permalink
Merge branch 'sunnyboy00-master'
Browse files Browse the repository at this point in the history
  • Loading branch information
nikhilm committed Sep 21, 2014
2 parents c97df2d + a71caea commit 14ac232
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions code/multi-echo-server/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ void on_new_connection(uv_stream_t *server, int status) {
return;
}

uv_pipe_t *client = (uv_pipe_t*) malloc(sizeof(uv_pipe_t));
uv_pipe_init(loop, client, 0);
uv_tcp_t *client = (uv_tcp_t*) malloc(sizeof(uv_tcp_t));
uv_tcp_init(loop, client);
if (uv_accept(server, (uv_stream_t*) client) == 0) {
uv_write_t *write_req = (uv_write_t*) malloc(sizeof(uv_write_t));
dummy_buf = uv_buf_init(".", 1);
Expand Down
4 changes: 2 additions & 2 deletions code/multi-echo-server/worker.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ void on_new_connection(uv_pipe_t *q, ssize_t nread, uv_buf_t buf, uv_handle_type
return;
}

uv_pipe_t *client = (uv_pipe_t*) malloc(sizeof(uv_pipe_t));
uv_pipe_init(loop, client, 0);
uv_tcp_t *client = (uv_tcp_t*) malloc(sizeof(uv_tcp_t));
uv_tcp_init(loop, client, 0);
if (uv_accept((uv_stream_t*) q, (uv_stream_t*) client) == 0) {
fprintf(stderr, "Worker %d: Accepted fd %d\n", getpid(), client->io_watcher.fd);
uv_read_start((uv_stream_t*) client, alloc_buffer, echo_read);
Expand Down

0 comments on commit 14ac232

Please sign in to comment.