Skip to content

Instantly share code, notes, and snippets.

@kelunik
Created April 9, 2021 14:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kelunik/c82ce751c1c203806b10ef7326f3e56a to your computer and use it in GitHub Desktop.
Save kelunik/c82ce751c1c203806b10ef7326f3e56a to your computer and use it in GitHub Desktop.
diff --git a/ext/standard/filters.c b/ext/standard/filters.c
index 466d352523..b954491d87 100644
--- a/ext/standard/filters.c
+++ b/ext/standard/filters.c
@@ -1867,6 +1867,11 @@ static php_stream_filter_status_t php_chunked_filter(
consumed += bucket->buflen;
bucket->buflen = php_dechunk(bucket->buf, bucket->buflen, data);
php_stream_bucket_append(buckets_out, bucket);
+
+ if (data->state == CHUNK_TRAILER) {
+ php_stream_xport_shutdown(stream, STREAM_SHUT_RDWR);
+ break;
+ }
}
if (bytes_consumed) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment