fix typo
[brisk.git] / web / Obj / transports.phh
index 69fe089..0cc5f54 100644 (file)
@@ -94,15 +94,17 @@ class Transport_websocket {
     protected $magicGUID = "258EAFA5-E914-47DA-95CA-C5AB0DC85B11";
 
     function Transport_websocket($secure = FALSE) {
+        $this->type = ($secure == FALSE ? "websocket" : "websocketsec");
         $this->headerOriginRequired                 = false;
         $this->headerSecWebSocketProtocolRequired   = false;
         $this->headerSecWebSocketExtensionsRequired = false;
 
         $this->sendingContinuous = false;
-       $this->sendingContinuous = false;
-       $this->partialMessage = "";
 
-       $this->hasSentClose = false;
+        $this->handlingPartialPacket = false;
+        $this->partialMessage = "";
+
+        $this->hasSentClose = false;
     }
 
     protected function extractHeaders($message) {
@@ -201,6 +203,12 @@ class Transport_websocket {
         return $strout . "\n";
     }
 
+    function unchunk($cont)
+    {
+        // fprintf(STDERR, "CHUNK: [%s]\n", $cont);
+        return $this->deframe($cont);
+    }
+
     function chunk($step, $cont)
     {
         // fprintf(STDERR, "CHUNK: [%s]\n", $cont);
@@ -483,6 +491,7 @@ class Transport_websocket {
 class Transport_xhr {
 
     function Transport_xhr() {
+        $this->type = 'xhr';
     }
 
     function init($enc, $header, &$header_out, $init_string, $base, $step)
@@ -523,6 +532,7 @@ class Transport_xhr {
 class Transport_iframe {
 
     function Transport_iframe() {
+        $this->type = 'iframe';
     }
 
     function init($enc, $header, &$header_out, $init_string, $base, $step)
@@ -600,6 +610,9 @@ push(\"%s\");\n// -->\n</script>", $step, escpush($cont) );
 }
 
 class Transport_htmlfile extends Transport_iframe {
+    function Transport_htmlfile() {
+        $this->type = 'htmlfile';
+    }
 }
 
 class Transport {
@@ -609,8 +622,8 @@ class Transport {
 
     static function create($transp)
     {
-        if ($transp == 'websocket') {
-            return new Transport_websocket();
+        if ($transp == 'websocket' || $transp == 'websocketsec') {
+            return new Transport_websocket($transp == 'websocketsec');
         }
         else if ($transp == 'xhr') {
             return new Transport_xhr();
@@ -632,4 +645,4 @@ class Transport {
         }
     }
 }
-?>
\ No newline at end of file
+?>