Browse Source

解决Benchmark内存泄漏

liangl 11 years ago
parent
commit
da6e735836
1 changed files with 5 additions and 3 deletions
  1. 5 3
      applications/Benchmark/Benchmark.php

+ 5 - 3
applications/Benchmark/Benchmark.php

@@ -27,10 +27,12 @@ class Benchmark extends Man\Core\SocketWorker
         // 是HTTP协议
         if('G' == $buffer[0] )
         {
-            $this->sendToClient("HTTP/1.1 200 OK\r\nContent-Length: 5\r\n\r\nhello");
-            return $this->closeClient($this->currentDealFd);
+            // http 改成短链接
+            $this->isPersistentConnection = 0;
+            return $this->sendToClient("HTTP/1.1 200 OK\r\nContent-Length: 5\r\n\r\nhello");
         }
-        // 是benchmark脚本
+        // 是benchmark脚本, 长链接
+        $this->isPersistentConnection = 1;
         return $this->sendToClient($buffer);
     }