浏览代码

Merge pull request #212 from ares333/patch-1

Solving int overflows
walkor 8 年之前
父节点
当前提交
14c7b488ae
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      Connection/TcpConnection.php

+ 3 - 0
Connection/TcpConnection.php

@@ -264,6 +264,9 @@ class TcpConnection extends ConnectionInterface
     {
         self::$statistics['connection_count']++;
         $this->id      = $this->_id = self::$_idRecorder++;
+        if(self::$_idRecorder===PHP_INT_MAX){
+            self::$_idRecorder=0;
+        }
         $this->_socket = $socket;
         stream_set_blocking($this->_socket, 0);
         // Compatible with hhvm