File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -127,6 +127,9 @@ class TcpTransportExecutor implements ExecutorInterface
127127 private $ readBuffer = '' ;
128128 private $ readPending = false ;
129129
130+ /** @var string */
131+ private $ readChunk = 0xffff ;
132+
130133 /**
131134 * @param string $nameserver
132135 * @param ?LoopInterface $loop
@@ -181,7 +184,7 @@ public function query(Query $query)
181184 // set socket to non-blocking and wait for it to become writable (connection success/rejected)
182185 \stream_set_blocking ($ socket , false );
183186 if (\function_exists ('stream_set_chunk_size ' )) {
184- \stream_set_chunk_size ($ socket , ( int ) (( 1 << 31 ) - 1 ) ); // @codeCoverageIgnore
187+ \stream_set_chunk_size ($ socket , $ this -> readChunk ); // @codeCoverageIgnore
185188 }
186189 $ this ->socket = $ socket ;
187190 }
@@ -270,7 +273,7 @@ public function handleRead()
270273 {
271274 // read one chunk of data from the DNS server
272275 // any error is fatal, this is a stream of TCP/IP data
273- $ chunk = @\fread ($ this ->socket , 65536 );
276+ $ chunk = @\fread ($ this ->socket , $ this -> readChunk );
274277 if ($ chunk === false || $ chunk === '' ) {
275278 $ this ->closeError ('Connection to DNS server ' . $ this ->nameserver . ' lost ' );
276279 return ;
You can’t perform that action at this time.
0 commit comments