| 1015 | } |
| 1016 | |
| 1017 | void I2CPSession::SendHostReplyMessage (uint32_t requestID, std::shared_ptr<const i2p::data::IdentityEx> identity) |
| 1018 | { |
| 1019 | if (identity) |
| 1020 | { |
| 1021 | size_t l = identity->GetFullLen () + 7; |
| 1022 | uint8_t * buf = new uint8_t[l]; |
| 1023 | htobe16buf (buf, m_SessionID); |
| 1024 | htobe32buf (buf + 2, requestID); |
| 1025 | buf[6] = 0; // result code |
| 1026 | identity->ToBuffer (buf + 7, l - 7); |
| 1027 | SendI2CPMessage (I2CP_HOST_REPLY_MESSAGE, buf, l); |
| 1028 | delete[] buf; |
| 1029 | } |
| 1030 | else |
| 1031 | { |
| 1032 | uint8_t buf[7]; |
| 1033 | htobe16buf (buf, m_SessionID); |
| 1034 | htobe32buf (buf + 2, requestID); |
| 1035 | buf[6] = 1; // result code |
| 1036 | SendI2CPMessage (I2CP_HOST_REPLY_MESSAGE, buf, 7); |
| 1037 | } |
| 1038 | } |
| 1039 | |
| 1040 | void I2CPSession::DestLookupMessageHandler (const uint8_t * buf, size_t len) |
| 1041 | { |
no test coverage detected