Merge pull request #51: Fix #80729: ssh2_shell() streams are not stream_select()able

This commit is contained in:
Casper Langemeijer
2021-02-24 22:05:53 +01:00
2 changed files with 3 additions and 2 deletions

View File

@@ -22,6 +22,7 @@
#include <libssh2.h>
#include <libssh2_sftp.h>
#include "ext/standard/url.h"
#include "main/php_network.h"
#define PHP_SSH2_VERSION "1.2"
#define PHP_SSH2_DEFAULT_PORT 22
@@ -64,7 +65,7 @@ typedef struct _php_ssh2_session_data {
zval *macerror_cb;
zval *disconnect_cb;
int socket;
php_socket_t socket;
} php_ssh2_session_data;
typedef struct _php_ssh2_sftp_data {

View File

@@ -171,7 +171,7 @@ static int php_ssh2_channel_stream_cast(php_stream *stream, int castas, void **r
case PHP_STREAM_AS_FD_FOR_SELECT:
case PHP_STREAM_AS_SOCKETD:
if (ret) {
*(int *)ret = (*session_data)->socket;
*(php_socket_t *)ret = (*session_data)->socket;
}
return SUCCESS;
default: