File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -188,9 +188,10 @@ public function connect($uri)
188188
189189 $ stream ->write ("CONNECT " . $ host . ": " . $ port . " HTTP/1.1 \r\nHost: " . $ host . ": " . $ port . "\r\n" . $ auth . "\r\n" );
190190
191- return $ deferred ->promise ()->always (function () use ($ stream , $ fn ) {
192- // Stop buffering when connection has been established or rejected .
191+ return $ deferred ->promise ()->then (function (ConnectionInterface $ stream ) use ($ fn ) {
192+ // Stop buffering when connection has been established.
193193 $ stream ->removeListener ('data ' , $ fn );
194+ return new Promise \FulfilledPromise ($ stream );
194195 });
195196 }, function (Exception $ e ) use ($ proxyUri ) {
196197 throw new RuntimeException ('Unable to connect to proxy (ECONNREFUSED) ' , defined ('SOCKET_ECONNREFUSED ' ) ? SOCKET_ECONNREFUSED : 111 , $ e );
You can’t perform that action at this time.
0 commit comments