diff options
| author | Wez Furlong <wez@php.net> | 2003-02-28 21:03:36 +0000 |
|---|---|---|
| committer | Wez Furlong <wez@php.net> | 2003-02-28 21:03:36 +0000 |
| commit | 349ce76f9660850c0a15f660dff7cebb81c0abc8 (patch) | |
| tree | cd03704ec5665e40106e5c509e3fb313c4423c50 /ext | |
| parent | 1ad304c2c529905c9a157afa8d3bb57f26481f7e (diff) | |
| download | php-git-349ce76f9660850c0a15f660dff7cebb81c0abc8.tar.gz | |
Tidy up stupid signed/unsigned issues with win32 by introducing a php_socket_t typedef.
Diffstat (limited to 'ext')
| -rw-r--r-- | ext/ftp/ftp.c | 16 | ||||
| -rw-r--r-- | ext/ftp/ftp.h | 4 | ||||
| -rw-r--r-- | ext/standard/streamsfuncs.c | 9 |
3 files changed, 16 insertions, 13 deletions
diff --git a/ext/ftp/ftp.c b/ext/ftp/ftp.c index 4601a6e321..6a472abe83 100644 --- a/ext/ftp/ftp.c +++ b/ext/ftp/ftp.c @@ -86,9 +86,9 @@ static int ftp_putcmd( ftpbuf_t *ftp, const char *args); /* wrapper around send/recv to handle timeouts */ -static int my_send(ftpbuf_t *ftp, int s, void *buf, size_t len); -static int my_recv(ftpbuf_t *ftp, int s, void *buf, size_t len); -static int my_accept(ftpbuf_t *ftp, int s, struct sockaddr *addr, +static int my_send(ftpbuf_t *ftp, php_socket_t s, void *buf, size_t len); +static int my_recv(ftpbuf_t *ftp, php_socket_t s, void *buf, size_t len); +static int my_accept(ftpbuf_t *ftp, php_socket_t s, struct sockaddr *addr, int *addrlen); /* reads a line the socket , returns true on success, false on error */ @@ -1173,7 +1173,7 @@ ftp_getresp(ftpbuf_t *ftp) /* {{{ my_send */ int -my_send(ftpbuf_t *ftp, int s, void *buf, size_t len) +my_send(ftpbuf_t *ftp, php_socket_t s, void *buf, size_t len) { fd_set write_set; struct timeval tv; @@ -1225,7 +1225,7 @@ my_send(ftpbuf_t *ftp, int s, void *buf, size_t len) /* {{{ my_recv */ int -my_recv(ftpbuf_t *ftp, int s, void *buf, size_t len) +my_recv(ftpbuf_t *ftp, php_socket_t s, void *buf, size_t len) { fd_set read_set; struct timeval tv; @@ -1265,7 +1265,7 @@ my_recv(ftpbuf_t *ftp, int s, void *buf, size_t len) /* {{{ data_available */ int -data_available(ftpbuf_t *ftp, int s) +data_available(ftpbuf_t *ftp, php_socket_t s) { fd_set read_set; struct timeval tv; @@ -1292,7 +1292,7 @@ data_available(ftpbuf_t *ftp, int s) /* {{{ data_writeable */ int -data_writeable(ftpbuf_t *ftp, int s) +data_writeable(ftpbuf_t *ftp, php_socket_t s) { fd_set write_set; struct timeval tv; @@ -1320,7 +1320,7 @@ data_writeable(ftpbuf_t *ftp, int s) /* {{{ my_accept */ int -my_accept(ftpbuf_t *ftp, int s, struct sockaddr *addr, int *addrlen) +my_accept(ftpbuf_t *ftp, php_socket_t s, struct sockaddr *addr, int *addrlen) { fd_set accept_set; struct timeval tv; diff --git a/ext/ftp/ftp.h b/ext/ftp/ftp.h index 2fffe08f94..f934a989ee 100644 --- a/ext/ftp/ftp.h +++ b/ext/ftp/ftp.h @@ -46,7 +46,7 @@ typedef enum ftptype { typedef struct databuf { int listener; /* listener socket */ - int fd; /* data connection */ + php_socket_t fd; /* data connection */ ftptype_t type; /* transfer type */ char buf[FTP_BUFSIZE]; /* data buffer */ #if HAVE_OPENSSL_EXT @@ -57,7 +57,7 @@ typedef struct databuf typedef struct ftpbuf { - int fd; /* control connection */ + php_socket_t fd; /* control connection */ php_sockaddr_storage localaddr; /* local address */ int resp; /* last response code */ char inbuf[FTP_BUFSIZE]; /* last response text */ diff --git a/ext/standard/streamsfuncs.c b/ext/standard/streamsfuncs.c index 110058ac26..4e46d7694a 100644 --- a/ext/standard/streamsfuncs.c +++ b/ext/standard/streamsfuncs.c @@ -28,10 +28,13 @@ #include "ext/standard/basic_functions.h" #include "php_ini.h" #include "streamsfuncs.h" - +#include "php_network.h" +#include "php_string.h" #ifndef PHP_WIN32 #define php_select(m, r, w, e, t) select(m, r, w, e, t) +#else +#include "win32/select.h" #endif static php_stream_context *decode_context_param(zval *contextresource TSRMLS_DC); @@ -342,11 +345,11 @@ PHP_FUNCTION(stream_get_wrappers) /* }}} */ /* {{{ stream_select related functions */ -static int stream_array_to_fd_set(zval *stream_array, fd_set *fds, int *max_fd TSRMLS_DC) +static int stream_array_to_fd_set(zval *stream_array, fd_set *fds, php_socket_t *max_fd TSRMLS_DC) { zval **elem; php_stream *stream; - int this_fd; + php_socket_t this_fd; if (Z_TYPE_P(stream_array) != IS_ARRAY) { return 0; |
