Преглед на файлове

Tolerate fragmented ServerInit.

Issue #39: https://github.com/kanaka/noVNC/issues/issue/39
Joel Martin преди 15 години
родител
ревизия
318d473438
променени са 1 файла, в които са добавени 2 реда и са изтрити 6 реда
  1. 2 6
      include/rfb.js

+ 2 - 6
include/rfb.js

@@ -815,9 +815,7 @@ init_msg = function() {
         break;
         break;
 
 
     case 'SecurityResult' :
     case 'SecurityResult' :
-        if (rQlen() < 4) {
-            return fail("Invalid VNC auth response");
-        }
+        if (rQwait("VNC auth response ", 24)) { return false; }
         switch (rQshift32()) {
         switch (rQshift32()) {
             case 0:  // OK
             case 0:  // OK
                 // Fall through to ClientInitialisation
                 // Fall through to ClientInitialisation
@@ -848,9 +846,7 @@ init_msg = function() {
         break;
         break;
 
 
     case 'ServerInitialisation' :
     case 'ServerInitialisation' :
-        if (rQlen() < 24) {
-            return fail("Invalid server initialisation");
-        }
+        if (rQwait("server initialization", 24)) { return false; }
 
 
         /* Screen size */
         /* Screen size */
         fb_width  = rQshift16();
         fb_width  = rQshift16();