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

rfb.js: wait for SecurityResult failure reason bytes.

Yet another weird VNC server behavior: sending a failure and length
before the reason message. To calculated the length, the reason string
is already available, why not just send everything as one packet. Oh
well.
Joel Martin преди 15 години
родител
ревизия
aa78706983
променени са 1 файла, в които са добавени 5 реда и са изтрити 0 реда
  1. 5 0
      include/rfb.js

+ 5 - 0
include/rfb.js

@@ -797,6 +797,11 @@ init_msg = function() {
             case 1:  // failed
                 if (rfb_version >= 3.8) {
                     reason_len = rQshift32();
+                    if (rQlen() < reason_len) {
+                        Util.Debug("   waiting for SecurityResult reason bytes");
+                        rQi -= 8; // Unshift the status and length
+                        return;
+                    }
                     reason = rQshiftStr(reason_len);
                     updateState('failed', reason);
                 } else {