+ var $method; // method used to request the page
+ var $header; // array of header fields
+ var $get; // array of get args
+ var $post; // array of post args
+ var $cookie; // array of cookie args
+ var $path; // requested path
+ var $addr; // source address
+ var $contsz; // expected content size
+ var $rest; // number of missing bytest
+
+ function PendingPage($socket, $curtime, $kalive)
+ {
+ $this->socket = $socket;
+ $this->kalive = $curtime + $kalive;
+ }
+
+ static function pendingpage_waiting($socket, $curtime, $kalive, $method, $header,
+ $get, $post, $cookie, $path, $addr, $rest)
+ {
+ $thiz = new PendingPage($socket, $curtime, $kalive);
+ $thiz->status = PENDINGPAGE_WAITDATA;
+
+ $thiz->method = $method;
+ $thiz->header = $header;
+ $thiz->get = $get;
+ $thiz->post = $post;
+ $thiz->cookie = $cookie;
+ $thiz->path = $path;
+ $thiz->addr = $addr;
+ $thiz->contsz = $header['Content-Length'];
+ $thiz->rest = $rest;
+
+ return ($thiz);
+ }
+
+ function try_wait($curtime)
+ {
+ // if completed return TRUE to allow data to be processed,
+ // if timeout or max content dimension is exceeded move to flushing
+ }
+
+ static function pendingpage_flushing($socket, $curtime, $kalive, $enc, $header_out, $body)
+ {
+ $thiz = new PendingPage($socket, $curtime, $kalive);
+
+ $thiz->to_flushing($enc, $header_out, $body);
+
+ return ($thiz);
+ }
+
+ function to_flushing($enc, &$header_out, $body)