()
| 2651 | } |
| 2652 | |
| 2653 | _handleServerFenceMsg() { |
| 2654 | if (this._sock.rQwait("ServerFence header", 8, 1)) { return false; } |
| 2655 | this._sock.rQskipBytes(3); // Padding |
| 2656 | let flags = this._sock.rQshift32(); |
| 2657 | let length = this._sock.rQshift8(); |
| 2658 | |
| 2659 | if (this._sock.rQwait("ServerFence payload", length, 9)) { return false; } |
| 2660 | |
| 2661 | if (length > 64) { |
| 2662 | Log.Warn("Bad payload length (" + length + ") in fence response"); |
| 2663 | length = 64; |
| 2664 | } |
| 2665 | |
| 2666 | const payload = this._sock.rQshiftStr(length); |
| 2667 | |
| 2668 | this._supportsFence = true; |
| 2669 | |
| 2670 | /* |
| 2671 | * Fence flags |
| 2672 | * |
| 2673 | * (1<<0) - BlockBefore |
| 2674 | * (1<<1) - BlockAfter |
| 2675 | * (1<<2) - SyncNext |
| 2676 | * (1<<31) - Request |
| 2677 | */ |
| 2678 | |
| 2679 | if (!(flags & (1<<31))) { |
| 2680 | return this._fail("Unexpected fence response"); |
| 2681 | } |
| 2682 | |
| 2683 | // Filter out unsupported flags |
| 2684 | // FIXME: support syncNext |
| 2685 | flags &= (1<<0) | (1<<1); |
| 2686 | |
| 2687 | // BlockBefore and BlockAfter are automatically handled by |
| 2688 | // the fact that we process each incoming message |
| 2689 | // synchronuosly. |
| 2690 | RFB.messages.clientFence(this._sock, flags, payload); |
| 2691 | |
| 2692 | return true; |
| 2693 | } |
| 2694 | |
| 2695 | _handleXvpMsg() { |
| 2696 | if (this._sock.rQwait("XVP version and message", 3, 1)) { return false; } |
no test coverage detected