mirror of
https://github.com/PurpleI2P/i2pd
synced 2024-11-10 08:00:38 +03: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
|
||||
size_t bsz = base64.size();
|
||||
size_t sz = 4 + bsz + 1 + len;
|
||||
size_t sz = bsz + 1 + len;
|
||||
// build datagram body
|
||||
uint8_t * data = new uint8_t[sz];
|
||||
data[0] = '3';
|
||||
data[1] = '.';
|
||||
data[2] = '0';
|
||||
data[3] = ' ';
|
||||
memcpy(data+4, base64.c_str(), bsz);
|
||||
data[4+bsz] = '\n';
|
||||
memcpy(data+4+bsz+1, buf, len);
|
||||
// Destination
|
||||
memcpy(data, base64.c_str(), bsz);
|
||||
// linefeed
|
||||
data[bsz] = '\n';
|
||||
// Payload
|
||||
memcpy(data+bsz+1, buf, len);
|
||||
// send to remote endpoint
|
||||
m_Owner.SendTo(data, sz, ep);
|
||||
delete [] buf;
|
||||
|
Loading…
Reference in New Issue
Block a user