summaryrefslogtreecommitdiff
path: root/deps/uv/test/benchmark-ping-pongs.c
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2011-06-09 15:14:58 +0200
committerRyan Dahl <ry@tinyclouds.org>2011-06-10 18:17:44 +0200
commit623f513071ac2551b9812e9d4ebaf482ba535d46 (patch)
tree119085bd4ebd7a92840f1311c17ab24f8e791b2a /deps/uv/test/benchmark-ping-pongs.c
parent09ac99f1f4be6dc4d90152c79a4ab7e0f9068550 (diff)
downloadandroid-node-v8-623f513071ac2551b9812e9d4ebaf482ba535d46.tar.gz
android-node-v8-623f513071ac2551b9812e9d4ebaf482ba535d46.tar.bz2
android-node-v8-623f513071ac2551b9812e9d4ebaf482ba535d46.zip
Upgrade libuv
Diffstat (limited to 'deps/uv/test/benchmark-ping-pongs.c')
-rw-r--r--deps/uv/test/benchmark-ping-pongs.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/deps/uv/test/benchmark-ping-pongs.c b/deps/uv/test/benchmark-ping-pongs.c
index 9fdd560821..9b5543251c 100644
--- a/deps/uv/test/benchmark-ping-pongs.c
+++ b/deps/uv/test/benchmark-ping-pongs.c
@@ -78,11 +78,9 @@ static void buf_free(uv_buf_t uv_buf_t) {
}
-static void pinger_close_cb(uv_handle_t* handle, int status) {
+static void pinger_close_cb(uv_handle_t* handle) {
pinger_t* pinger;
- ASSERT(status == 0);
-
pinger = (pinger_t*)handle->data;
LOGF("ping_pongs: %d roundtrips/s\n", (1000 * pinger->pongs) / TIME);
@@ -127,7 +125,7 @@ static void pinger_shutdown_cb(uv_handle_t* handle, int status) {
}
-static void pinger_read_cb(uv_tcp_t* tcp, int nread, uv_buf_t buf) {
+static void pinger_read_cb(uv_tcp_t* tcp, ssize_t nread, uv_buf_t buf) {
unsigned int i;
pinger_t* pinger;
@@ -141,7 +139,7 @@ static void pinger_read_cb(uv_tcp_t* tcp, int nread, uv_buf_t buf) {
}
ASSERT(pinger_shutdown_cb_called == 1);
- uv_close((uv_handle_t*)tcp);
+ uv_close((uv_handle_t*)tcp, pinger_close_cb);
return;
}
@@ -190,9 +188,11 @@ static void pinger_new() {
pinger->pongs = 0;
/* Try to connec to the server and do NUM_PINGS ping-pongs. */
- r = uv_tcp_init(&pinger->tcp, pinger_close_cb, (void*)pinger);
+ r = uv_tcp_init(&pinger->tcp);
ASSERT(!r);
+ pinger->tcp.data = pinger;
+
/* We are never doing multiple reads/connects at a time anyway. */
/* so these handles can be pre-initialized. */
uv_req_init(&pinger->connect_req, (uv_handle_t*)&pinger->tcp,