php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login

Patch bug71114_0 for FTP related Bug #71114

Patch version 2015-12-14 14:22 UTC

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

Developer: ab@php.net

diff --git a/ext/ftp/ftp.c b/ext/ftp/ftp.c
index bb41b1a..6767257 100644
--- a/ext/ftp/ftp.c
+++ b/ext/ftp/ftp.c
@@ -1311,12 +1311,13 @@ my_send(ftpbuf_t *ftp, php_socket_t s, void *buf, size_t len)
 						break;
 
 					case SSL_ERROR_WANT_READ:
+					case SSL_ERROR_WANT_WRITE:
 					case SSL_ERROR_WANT_CONNECT: {
 							php_pollfd p;
 							int i;
 
 							p.fd = fd;
-							p.events = POLLOUT;
+							p.events = (err == SSL_ERROR_WANT_READ) ? (POLLIN|POLLPRI) : POLLOUT;
 							p.revents = 0;
 
 							i = php_poll2(&p, 1, 300);
@@ -1400,12 +1401,13 @@ my_recv(ftpbuf_t *ftp, php_socket_t s, void *buf, size_t len)
 					break;
 
 				case SSL_ERROR_WANT_READ:
+				case SSL_ERROR_WANT_WRITE:
 				case SSL_ERROR_WANT_CONNECT: {
 						php_pollfd p;
 						int i;
 
 						p.fd = fd;
-						p.events = POLLIN|POLLPRI;
+						p.events = (err == SSL_ERROR_WANT_READ) ? (POLLIN|POLLPRI) : POLLOUT;
 						p.revents = 0;
 
 						i = php_poll2(&p, 1, 300);
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 18:01:29 2024 UTC