Skip to content

Commit 682f12b

Browse files
committed
io: add cast to xp_ssl
1 parent d7d4e10 commit 682f12b

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

ext/openssl/xp_ssl.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
#include "zend_exceptions.h"
3030
#include "php_openssl.h"
3131
#include "php_openssl_backend.h"
32-
#include "php_network.h"
32+
#include "php_io.h"
3333
#include <openssl/ssl.h>
3434
#include <openssl/rsa.h>
3535
#include <openssl/x509.h>
@@ -2605,6 +2605,16 @@ static int php_openssl_sockop_cast(php_stream *stream, int castas, void **ret)
26052605
*(php_socket_t *)ret = sslsock->s.socket;
26062606
}
26072607
return SUCCESS;
2608+
case PHP_STREAM_AS_FD_FOR_COPY:
2609+
if (sslsock->ssl_active) {
2610+
return FAILURE;
2611+
}
2612+
if (ret) {
2613+
php_io_fd *copy_fd = (php_io_fd *) ret;
2614+
copy_fd->socket = sslsock->s.socket;
2615+
copy_fd->fd_type = PHP_IO_FD_SOCKET;
2616+
}
2617+
return SUCCESS;
26082618
default:
26092619
return FAILURE;
26102620
}

0 commit comments

Comments
 (0)