aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArmen Baghumian <abaghumian@noggin.com.au>2017-06-25 07:55:39 +1000
committerArmen Baghumian <abaghumian@noggin.com.au>2017-06-25 07:58:17 +1000
commit8ea182c7601af96ec27cc5e99353cf14f4850f7c (patch)
tree3f55abe0491a31ce09cf5e9941da9f8d187713b9
parentdabdd309da9cb338d7606632ed0390bed68e8b16 (diff)
downloadFastcgi-8ea182c7601af96ec27cc5e99353cf14f4850f7c.zip
Fastcgi-8ea182c7601af96ec27cc5e99353cf14f4850f7c.tar.gz
Fastcgi-8ea182c7601af96ec27cc5e99353cf14f4850f7c.tar.bz2
Support for requests larger than 65535 bytes
-rw-r--r--Responder.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/Responder.php b/Responder.php
index e797bf7..b8bd888 100644
--- a/Responder.php
+++ b/Responder.php
@@ -203,7 +203,12 @@ class Responder extends Connection
$request .= $this->pack(self::REQUEST_PARAMETERS, '');
if (null !== $content) {
- $request .= $this->pack(self::STREAM_STDIN, $content);
+ // The maximum length of each record is 65535 bytes, pack multiple
+ // records if the length is larger than the 65535 bytes
+ $contents = str_split($content, 65535);
+ foreach ($contents as $content) {
+ $request .= $this->pack(self::STREAM_STDIN, $content);
+ }
}
$request .= $this->pack(self::STREAM_STDIN, '');