php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #60471
Patch removes-unexpected-eof-message-from-cli-server.patch revision 2012-02-25 15:13 UTC by michal dot pipa dot xsolve at gmail dot com

Patch removes-unexpected-eof-message-from-cli-server.patch for Built-in web server Bug #60471

Patch version 2012-02-25 15:13 UTC

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

Developer: michal.pipa.xsolve@gmail.com

Index: sapi/cli/php_cli_server.c
===================================================================
--- sapi/cli/php_cli_server.c	(revision 323483)
+++ sapi/cli/php_cli_server.c	(working copy)
@@ -1589,7 +1589,6 @@
 		*errstr = php_socket_strerror(err, NULL, 0);
 		return -1;
 	} else if (nbytes_read == 0) {
-		*errstr = estrdup("Unexpected EOF");
 		return -1;
 	}
 	client->parser.data = client;
@@ -2199,8 +2198,11 @@
 	char *errstr = NULL;
 	int status = php_cli_server_client_read_request(client, &errstr TSRMLS_CC);
 	if (status < 0) {
-		php_cli_server_logf("%s Invalid request (%s)" TSRMLS_CC, client->addr_str, errstr);
-		efree(errstr);
+		if (errstr) {
+			php_cli_server_logf("%s Invalid request (%s)" TSRMLS_CC, client->addr_str, errstr);
+			efree(errstr);
+		}
+		
 		php_cli_server_close_connection(server, client TSRMLS_CC);
 		return FAILURE;
 	} else if (status == 1) {
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Dec 03 17:01:29 2024 UTC