X-Git-Url: http://mop.ddnsfree.com/gitweb/?a=blobdiff_plain;f=web%2FObj%2Ftransports.phh;h=69fe0898c909c0b05368f4f541c8feda3e185079;hb=fc19a0f063cf2e544a61a58b4ac31254f91d6ba5;hp=5ebfec470602686c324b30ff9e4f2bdbadf2ec05;hpb=ddd822f1dca51731cc9fc8199db3f1cc527fb01a;p=brisk.git diff --git a/web/Obj/transports.phh b/web/Obj/transports.phh index 5ebfec4..69fe089 100644 --- a/web/Obj/transports.phh +++ b/web/Obj/transports.phh @@ -93,7 +93,7 @@ class Transport_template { class Transport_websocket { protected $magicGUID = "258EAFA5-E914-47DA-95CA-C5AB0DC85B11"; - function Transport_websocket() { + function Transport_websocket($secure = FALSE) { $this->headerOriginRequired = false; $this->headerSecWebSocketProtocolRequired = false; $this->headerSecWebSocketExtensionsRequired = false; @@ -203,6 +203,7 @@ class Transport_websocket { function chunk($step, $cont) { + // fprintf(STDERR, "CHUNK: [%s]\n", $cont); return $this->frame('@BEGIN@'.$cont.'@END@'); // , 'text', TRUE); } @@ -385,15 +386,19 @@ class Transport_websocket { } if (!isset($headers['Host']) || !$this->checkHost($headers['Host'])) { + // error_log('bad 1'); $headers_out['HTTP-Response'] = "400 Bad Request"; } if (!isset($headers['Upgrade']) || strtolower($headers['Upgrade']) != 'websocket') { + // error_log('bad 2 ' . $headers['Upgrade']); $headers_out['HTTP-Response'] = "400 Bad Request"; } if (!isset($headers['Connection']) || strpos(strtolower($headers['Connection']), 'upgrade') === FALSE) { + // error_log('bad 3'); $headers_out['HTTP-Response'] = "400 Bad Request"; } if (!isset($headers['Sec-Websocket-Key'])) { + // error_log('bad 4'); $headers_out['HTTP-Response'] = "400 Bad Request"; } else { } @@ -409,11 +414,13 @@ class Transport_websocket { if ( ($this->headerSecWebSocketProtocolRequired && !isset($headers['Sec-Websocket-Protocol'])) || ($this->headerSecWebSocketProtocolRequired && !$this->checkWebsocProtocol($headers['Sec-Websocket-Protocol']))) { + // error_log('bad 5'); $headers_out['HTTP-Response'] = "400 Bad Request"; } if ( ($this->headerSecWebSocketExtensionsRequired && !isset($headers['Sec-Websocket-Extensions'])) || ($this->headerSecWebSocketExtensionsRequired && !$this->checkWebsocExtensions($headers['Sec-Websocket-Extensions'])) ) { + // error_log('bad 6'); $headers_out['HTTP-Response'] = "400 Bad Request"; } @@ -503,6 +510,7 @@ class Transport_xhr { function chunk($step, $cont) { + // fprintf(STDERR, "CHUNK: [%s]\n", $cont); return ("@BEGIN@".$cont."@END@"); } @@ -574,6 +582,7 @@ push(\"%s\"); function chunk($step, $cont) { + // fprintf(STDERR, "CHUNK: [%s]\n", $cont); if ($cont == NULL) { return sprintf("", $step);