php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #52323
Patch php-connect-errors.patch revision 2010-07-12 21:08 UTC by onno at flox dot org

Patch php-connect-errors.patch for Sockets related Bug #52323

Patch version 2010-07-12 21:08 UTC

Return to Bug #52323 | Download this patch
Patch Revisions:

Developer: onno@flox.org

Index: main/network.c
===================================================================
--- main/network.c	(revision 301215)
+++ main/network.c	(working copy)
@@ -362,13 +362,16 @@
 		RESTORE_SOCKET_BLOCKING_MODE(sockfd, orig_flags);
 	}
 
+	if (error) {
+		ret = -1;
+	}
+
 	if (error_code) {
 		*error_code = error;
 	}
 
 	if (error && error_string) {
 		*error_string = php_socket_strerror(error, NULL, 0);
-		ret = -1;
 	}
 	return ret;
 #else
@@ -1143,7 +1146,7 @@
 		if (ufds[i].events & POLLOUT) {
 			PHP_SAFE_FD_SET(ufds[i].fd, &wset);
 		}
-		if (ufds[i].events & POLLPRI) {
+		if (ufds[i].events & POLLERR) {
 			PHP_SAFE_FD_SET(ufds[i].fd, &eset);
 		}
 	}
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Oct 06 14:01:27 2024 UTC