php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #79723
Patch fcgi-read-eos.patch revision 2020-06-21 18:59 UTC by sam dot revitch at protonmail dot ch

Patch fcgi-read-eos.patch for FPM related Bug #79723

Patch version 2020-06-21 18:59 UTC

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

Developer: sam.revitch@protonmail.ch

--- php-7.4.6/main/fastcgi.c.orig	2020-05-12 01:09:15.000000000 -0700
+++ php-7.4.6/main/fastcgi.c	2020-06-21 11:54:30.504795567 -0700
@@ -219,6 +219,7 @@
 	int            ended;
 	int            in_len;
 	int            in_pad;
+	int            in_eos;
 
 	fcgi_header   *out_hdr;
 
@@ -1219,6 +1220,10 @@
 	fcgi_header hdr;
 	unsigned char buf[255];
 
+	if (req->in_eos == 1) {
+		return 0;
+	}
+
 	n = 0;
 	rest = len;
 	while (rest > 0) {
@@ -1232,6 +1237,7 @@
 			req->in_len = (hdr.contentLengthB1 << 8) | hdr.contentLengthB0;
 			req->in_pad = hdr.paddingLength;
 			if (req->in_len == 0) {
+				req->in_eos = 1;
 				return n;
 			}
 		}
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 26 11:01:30 2024 UTC