Skip to content

Instantly share code, notes, and snippets.

@bnoordhuis
Created April 20, 2013 20:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bnoordhuis/f3dc5a6df6f37b300c5e to your computer and use it in GitHub Desktop.
Save bnoordhuis/f3dc5a6df6f37b300c5e to your computer and use it in GitHub Desktop.
diff --git a/src/webserver.c b/src/webserver.c
index 2be3f29..81bbd9a 100644
--- a/src/webserver.c
+++ b/src/webserver.c
@@ -122,8 +122,9 @@ void after_write(uv_write_t* req, int status)
uv_write_count++;
if (uv_write_count > 10)
{
- exit(0);
+ //exit(0);^M
}
+ free(req);^M
}
int write_response(http_parser* parser)
@@ -132,8 +133,9 @@ int write_response(http_parser* parser)
printf(" write_response()\n");
+ uv_write_t* write_req = malloc(sizeof(*write_req));^M
int r = uv_write(
- &client->write_req,
+ write_req,^M
(uv_stream_t*)&client->handle,
&resbuf,
1,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment