[php-src] master: sapi: use bool type for post_read global

Gina Peter Banyard <[email protected]> Tue, 28 Jul 2026 07:54:12 +0000
Newsgroups gmane.comp.php.cvs.general
Message-ID <[email protected]>
Author: Gina Peter Banyard (Girgias)
Date: 2026-07-28T08:53:12+01:00

Commit: https://github.com/php/php-src/commit/ec29a6bd768fc43a60d9f15a145140df059602c8
Raw diff: https://github.com/php/php-src/commit/ec29a6bd768fc43a60d9f15a145140df059602c8.diff

sapi: use bool type for post_read global

Changed paths:
  M  main/SAPI.c
  M  main/SAPI.h


Diff:

diff --git a/main/SAPI.c b/main/SAPI.c
index 523759ea79be..0ed241569db3 100644
--- a/main/SAPI.c
+++ b/main/SAPI.c
@@ -217,7 +217,7 @@ SAPI_API size_t sapi_read_post_block(char *buffer, size_t buflen)
 	}
 	if (read_bytes < buflen) {
 		/* done */
-		SG(post_read) = 1;
+		SG(post_read) = true;
 	}
 
 	return read_bytes;
@@ -418,7 +418,7 @@ SAPI_API void sapi_activate(void)
 	SG(request_info).post_entry = NULL;
 	SG(request_info).proto_num = 1000; /* Default to HTTP 1.0 */
 	SG(global_request_time) = 0;
-	SG(post_read) = 0;
+	SG(post_read) = false;
 	SG(send_header_fcc) = empty_fcall_info_cache;
 	/* It's possible to override this general case in the activate() callback, if necessary. */
 	if (SG(request_info).request_method && !strcmp(SG(request_info).request_method, "HEAD")) {
diff --git a/main/SAPI.h b/main/SAPI.h
index d34c12f1bbc8..1e9a81866382 100644
--- a/main/SAPI.h
+++ b/main/SAPI.h
@@ -132,7 +132,7 @@ typedef struct _sapi_globals_struct {
 	sapi_request_info request_info;
 	sapi_headers_struct sapi_headers;
 	int64_t read_post_bytes;
-	unsigned char post_read;
+	bool post_read;
 	unsigned char headers_sent;
 	zend_stat_t global_stat;
 	char *default_mimetype;