MCPcopy Create free account
hub / github.com/PurpleI2P/i2pd / PostGarlicMessage

Method PostGarlicMessage

libi2pd/RouterContext.cpp:1293–1311  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1291 }
1292
1293 void RouterContext::PostGarlicMessage (std::shared_ptr<I2NPMessage> msg)
1294 {
1295 uint8_t * buf = msg->GetPayload ();
1296 uint32_t len = bufbe32toh (buf);
1297 if (len > msg->GetLength ())
1298 {
1299 LogPrint (eLogWarning, "Router: garlic message length ", len, " exceeds I2NP message length ", msg->GetLength ());
1300 return;
1301 }
1302 buf += 4;
1303 if (!HandleECIESx25519TagMessage (buf, len)) // try tag first
1304 {
1305 // then Noise_N one-time decryption
1306 if (m_ECIESSession)
1307 m_ECIESSession->HandleNextMessage (buf, len);
1308 else
1309 LogPrint (eLogError, "Router: Session is not set for ECIES router");
1310 }
1311 }
1312
1313 void RouterContext::ProcessDeliveryStatusMessage (std::shared_ptr<I2NPMessage> msg)
1314 {

Callers

nothing calls this directly

Calls 5

bufbe32tohFunction · 0.85
LogPrintFunction · 0.85
GetPayloadMethod · 0.45
GetLengthMethod · 0.45
HandleNextMessageMethod · 0.45

Tested by

no test coverage detected