X-Git-Url: https://git.saurik.com/redis.git/blobdiff_plain/a6305f13d568858bf7a9246e4e457a3a90cd7837..HEAD:/src/redis-benchmark.c?ds=inline

diff --git a/src/redis-benchmark.c b/src/redis-benchmark.c
index 1be4c07d..ceab7072 100644
--- a/src/redis-benchmark.c
+++ b/src/redis-benchmark.c
@@ -1,6 +1,6 @@
 /* Redis benchmark utility.
  *
- * Copyright (c) 2009-2010, Salvatore Sanfilippo <antirez at gmail dot com>
+ * Copyright (c) 2009-2012, Salvatore Sanfilippo <antirez at gmail dot com>
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -106,7 +106,7 @@ static long long mstime(void) {
     long long mst;
 
     gettimeofday(&tv, NULL);
-    mst = ((long)tv.tv_sec)*1000;
+    mst = ((long long)tv.tv_sec)*1000;
     mst += tv.tv_usec/1000;
     return mst;
 }
@@ -201,7 +201,10 @@ static void readHandler(aeEventLoop *el, int fd, void *privdata, int mask) {
                 if (config.requests_finished < config.requests)
                     config.latency[config.requests_finished++] = c->latency;
                 c->pending--;
-                if (c->pending == 0) clientDone(c);
+                if (c->pending == 0) {
+                    clientDone(c);
+                    break;
+                }
             } else {
                 break;
             }