Skip to content

Commit d9f93e6

Browse files
committed
socket_connect() maps a provider timeout like the emulated wait, TLS accept sets the restore flag, two stale comments
1 parent 4f768f0 commit d9f93e6

4 files changed

Lines changed: 7 additions & 3 deletions

File tree

‎ext/openssl/xp_ssl.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3528,6 +3528,8 @@ static inline int php_openssl_tcp_sockop_accept(php_stream *stream, php_openssl_
35283528
clisockdata->s.socket = clisock;
35293529
clisockdata->s.is_blocked = true;
35303530
php_netstream_set_nonblocking(&clisockdata->s);
3531+
/* accepted by us, non-blocking already when the ring accepted it */
3532+
clisockdata->s.restore_blocking = true;
35313533

35323534
xparam->outputs.client = php_stream_alloc_rel(stream->ops, clisockdata, NULL, "r+");
35333535
if (xparam->outputs.client) {

‎ext/sockets/sockets.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -770,6 +770,7 @@ static int php_socket_connect(php_socket *sock, const struct sockaddr *addr, soc
770770
php_deadline dl = php_socket_op_deadline(sock, SO_SNDTIMEO, 0);
771771
int ret = php_io_connect_ex(o.stream, o.handle, sock->bsd_socket, addr, addrlen, &dl);
772772
php_socket_op_end(sock, &o);
773+
php_socket_op_errno(ret);
773774
if (ret != 0 && errno == PHP_SOCKET_WAIT_TIMEOUT) {
774775
set_errno(EINPROGRESS);
775776
}

‎ext/standard/tests/streams/hooks/scheduler.inc‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class Scheduler implements \Io\Hooks\Hooks
3333
return new \Io\Poll\OperationQueue();
3434
}
3535

36-
/* IO_HOOKS_CAPS=files,direct opts in to what the queue supports, default is its own set */
36+
/* IO_HOOKS_CAPS=files,directData,directAccept opts in to what the queue supports, default is its own set */
3737
public static function capabilities(\Io\OperationQueue $queue, ?array $wanted = null): array
3838
{
3939
if ($wanted === null) {

‎main/io/php_io_queue_poll.c‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -528,8 +528,9 @@ static zend_result php_io_poll_queue_cancel(php_io_queue *base, php_io_op *op)
528528
}
529529

530530
/* A registration retains the descriptor's record between waits, and an Edge pair arms it
531-
* edge-triggered for good. The record is found by descriptor, never through the registration,
532-
* so a record a replaced provider left behind costs nothing more than its memory. */
531+
* edge-triggered for good. The record is found through the registration while the queue's id
532+
* matches and by descriptor otherwise, so a record a replaced provider left behind costs nothing
533+
* more than its memory. */
533534
static zend_result php_io_poll_queue_add(php_io_queue *base, php_io_registration *registration)
534535
{
535536
php_io_poll_queue *q = (php_io_poll_queue *) base;

0 commit comments

Comments
 (0)