MCPcopy
hub / github.com/ph4ntonn/Stowaway / handleDataFromDownstream

Method handleDataFromDownstream

agent/process/process.go:213–228  ·  view source on GitHub ↗
(conn net.Conn, uuid string)

Source from the content-addressed store, hash-verified

211}
212
213func (agent *Agent) handleDataFromDownstream(conn net.Conn, uuid string) {
214 rMessage := protocol.PrepareAndDecideWhichRProtoFromLower(conn, global.G_Component.Secret, global.G_Component.UUID)
215
216 for {
217 header, message, err := protocol.DestructMessage(rMessage)
218 if err != nil {
219 downStreamOffline(agent.mgr, agent.options, uuid)
220 return
221 }
222
223 sMessage := protocol.PrepareAndDecideWhichSProtoToUpper(global.G_Component.Conn, global.G_Component.Secret, global.G_Component.UUID)
224
225 protocol.ConstructMessage(sMessage, header, message, true)
226 sMessage.SendMessage()
227 }
228}
229
230func changeRoute(header *protocol.Header) string {
231 route := header.Route

Callers 1

waitingChildMethod · 0.95

Calls 6

DestructMessageFunction · 0.92
ConstructMessageFunction · 0.92
downStreamOfflineFunction · 0.85
SendMessageMethod · 0.65

Tested by

no test coverage detected