Ver Fonte

Fix fwrite() on non-blocking SSL sockets

Fix  ```1409F07F: SSL routines: SSL3_WRITE_PENDING: bad write retry``` error.
Relate http://stackoverflow.com/questions/14695247/in-php-openssl-error-messages-error-1409f07f-ssl-routines-ssl3-write-pendin .
walkor há 8 anos atrás
pai
commit
081eb84da7
1 ficheiros alterados com 2 adições e 2 exclusões
  1. 2 2
      Connection/TcpConnection.php

+ 2 - 2
Connection/TcpConnection.php

@@ -280,7 +280,7 @@ class TcpConnection extends ConnectionInterface
 
         // Attempt to send data directly.
         if ($this->_sendBuffer === '') {
-            $len = @fwrite($this->_socket, $send_buffer);
+            $len = @fwrite($this->_socket, $send_buffer, 8192);
             // send successful.
             if ($len === strlen($send_buffer)) {
                 return true;
@@ -519,7 +519,7 @@ class TcpConnection extends ConnectionInterface
      */
     public function baseWrite()
     {
-        $len = @fwrite($this->_socket, $this->_sendBuffer);
+        $len = @fwrite($this->_socket, $this->_sendBuffer, 8192);
         if ($len === strlen($this->_sendBuffer)) {
             Worker::$globalEvent->del($this->_socket, EventInterface::EV_WRITE);
             $this->_sendBuffer = '';