mirror of
https://github.com/php/php-src.git
synced 2026-04-29 03:03:26 +02:00
+5
-2
@@ -368,9 +368,12 @@ PHPAPI int php_connect_nonb_win32(SOCKET sockfd,
|
||||
*/
|
||||
int php_hostconnect(const char *host, unsigned short port, int socktype, int timeout)
|
||||
{
|
||||
int n, repeatto, s, err;
|
||||
int n, repeatto, s;
|
||||
struct sockaddr **sal, **psal;
|
||||
struct timeval timeoutval;
|
||||
#ifdef PHP_WIN32
|
||||
int err;
|
||||
#endif
|
||||
|
||||
n = php_network_getaddresses(host, &sal);
|
||||
|
||||
@@ -765,7 +768,7 @@ printf("read_internal read %d/%d bytes\n", nr_bytes, sock->chunk_size);
|
||||
memcpy(WRITEPTR(sock), buf, nr_bytes);
|
||||
sock->writepos += nr_bytes;
|
||||
nr_read = nr_bytes;
|
||||
} else if(nr_bytes == 0 || (nr_bytes < 0 && errno != EWOULDBLOCK)) {
|
||||
} else if(nr_bytes == 0 || (nr_bytes < 0 && streams_socket_errno != EWOULDBLOCK)) {
|
||||
sock->eof = 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -43,6 +43,12 @@
|
||||
# define ftruncate(a, b) chsize(a, b)
|
||||
#endif /* defined(PHP_WIN32) */
|
||||
|
||||
#ifdef PHP_WIN32
|
||||
#define streams_socket_errno WSAGetLastError()
|
||||
#else
|
||||
#define streams_socket_errno errno
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
# include <netinet/in.h>
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user