mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-22 12:24:19 +00:00
use correct format
This commit is contained in:
parent
764b8ab7a5
commit
925c51420d
15
SAM.cpp
15
SAM.cpp
@ -733,16 +733,15 @@ namespace client
|
|||||||
{
|
{
|
||||||
// udp forward enabled
|
// udp forward enabled
|
||||||
size_t bsz = base64.size();
|
size_t bsz = base64.size();
|
||||||
size_t sz = 4 + bsz + 1 + len;
|
size_t sz = bsz + 1 + len;
|
||||||
// build datagram body
|
// build datagram body
|
||||||
uint8_t * data = new uint8_t[sz];
|
uint8_t * data = new uint8_t[sz];
|
||||||
data[0] = '3';
|
// Destination
|
||||||
data[1] = '.';
|
memcpy(data, base64.c_str(), bsz);
|
||||||
data[2] = '0';
|
// linefeed
|
||||||
data[3] = ' ';
|
data[bsz] = '\n';
|
||||||
memcpy(data+4, base64.c_str(), bsz);
|
// Payload
|
||||||
data[4+bsz] = '\n';
|
memcpy(data+bsz+1, buf, len);
|
||||||
memcpy(data+4+bsz+1, buf, len);
|
|
||||||
// send to remote endpoint
|
// send to remote endpoint
|
||||||
m_Owner.SendTo(data, sz, ep);
|
m_Owner.SendTo(data, sz, ep);
|
||||||
delete [] buf;
|
delete [] buf;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user