MCPcopy Index your code
hub / github.com/ContainerSSH/ContainerSSH / handleError

Method handleError

agentprotocol/server.go:290–314  ·  view source on GitHub ↗
(packet *Packet)

Source from the content-addressed store, hash-verified

288}
289
290func (c *ForwardCtx) handleError(packet *Packet) {
291 c.connMapMu.Lock()
292 defer c.connMapMu.Unlock()
293 conn, ok := c.connMap[packet.ConnectionId]
294 if !ok {
295 c.logger.Info(
296 message.NewMessage(
297 message.EAgentUnknownConnection,
298 "Received error packet with unknown connection id %d",
299 packet.ConnectionId,
300 ),
301 )
302 return
303 }
304
305 c.logger.Info(
306 message.NewMessage(
307 message.MAgentRemoteError,
308 "Received error packet for connection %d from remote",
309 packet.ConnectionId,
310 ),
311 )
312
313 _ = conn.CloseImm()
314}
315
316func (c *ForwardCtx) handleNewConnection(packet *Packet) {
317 newConnectionPacket, err := c.unmarshalNewConnection(packet.Payload)

Callers 1

handleBackendMethod · 0.95

Calls 3

NewMessageFunction · 0.92
CloseImmMethod · 0.80
InfoMethod · 0.65

Tested by

no test coverage detected