MCPcopy Create free account
hub / github.com/mscdex/ssh2 / failureReply

Method failureReply

lib/agent.js:852–870  ·  view source on GitHub ↗
(req)

Source from the content-addressed store, hash-verified

850
851 // Server->Client messages =================================================
852 failureReply(req) {
853 if (this[SYM_MODE] !== ROLE_SERVER)
854 throw new Error('Server-only method called with client role');
855
856 if (!(req instanceof AgentInboundRequest))
857 throw new Error('Wrong request argument');
858
859 if (req.hasResponded())
860 return true;
861
862 let p = 0;
863 const buf = Buffer.allocUnsafe(4 + 1);
864
865 writeUInt32BE(buf, buf.length - 4, p);
866
867 buf[p += 4] = SSH_AGENT_FAILURE;
868
869 return respond(this, req, buf);
870 }
871 getIdentitiesReply(req, keys) {
872 if (this[SYM_MODE] !== ROLE_SERVER)
873 throw new Error('Server-only method called with client role');

Callers 2

_writeMethod · 0.95

Calls 3

writeUInt32BEFunction · 0.85
respondFunction · 0.85
hasRespondedMethod · 0.80

Tested by

no test coverage detected