MCPcopy Create free account
hub / github.com/apache/cloudstack / _handleServerFenceMsg

Method _handleServerFenceMsg

systemvm/agent/noVNC/core/rfb.js:2653–2693  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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; }

Callers 1

_normalMsgMethod · 0.95

Calls 6

_failMethod · 0.95
rQwaitMethod · 0.80
rQskipBytesMethod · 0.80
rQshift32Method · 0.80
rQshift8Method · 0.80
rQshiftStrMethod · 0.80

Tested by

no test coverage detected