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)
188
188
189
189
$ stream ->write ("CONNECT " . $ host . ": " . $ port . " HTTP/1.1 \r\nHost: " . $ host . ": " . $ port . "\r\n" . $ auth . "\r\n" );
190
190
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.
193
193
$ stream ->removeListener ('data ' , $ fn );
194
+ return new Promise \FulfilledPromise ($ stream );
194
195
});
195
196
}, function (Exception $ e ) use ($ proxyUri ) {
196
197
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