mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-08-26 10:10:24 +01:00
calculate message size properly
Some checks are pending
Build Debian packages / bookworm (push) Waiting to run
Build Debian packages / bullseye (push) Waiting to run
Build Debian packages / trixie (push) Waiting to run
Build on FreeBSD / with UPnP (push) Waiting to run
Build on OSX / With USE_UPNP=no (push) Waiting to run
Build on OSX / With USE_UPNP=yes (push) Waiting to run
Build on Windows / clang-x86_64 (push) Waiting to run
Build on Windows / i686 (push) Waiting to run
Build on Windows / ucrt-x86_64 (push) Waiting to run
Build on Windows / x86_64 (push) Waiting to run
Build on Windows / CMake clang-x86_64 (push) Waiting to run
Build on Windows / CMake i686 (push) Waiting to run
Build on Windows / CMake ucrt-x86_64 (push) Waiting to run
Build on Windows / CMake x86_64 (push) Waiting to run
Build on Windows / XP (push) Waiting to run
Build on Ubuntu / Make with USE_UPNP=no (push) Waiting to run
Build on Ubuntu / Make with USE_UPNP=yes (push) Waiting to run
Build on Ubuntu / CMake with -DWITH_UPNP=OFF (push) Waiting to run
Build on Ubuntu / CMake with -DWITH_UPNP=ON (push) Waiting to run
Build containers / Building container for linux/386 (push) Waiting to run
Build containers / Building container for linux/amd64 (push) Waiting to run
Build containers / Building container for linux/arm64 (push) Waiting to run
Build containers / Building container for linux/arm/v7 (push) Waiting to run
Build containers / Pushing merged manifest (push) Blocked by required conditions
Some checks are pending
Build Debian packages / bookworm (push) Waiting to run
Build Debian packages / bullseye (push) Waiting to run
Build Debian packages / trixie (push) Waiting to run
Build on FreeBSD / with UPnP (push) Waiting to run
Build on OSX / With USE_UPNP=no (push) Waiting to run
Build on OSX / With USE_UPNP=yes (push) Waiting to run
Build on Windows / clang-x86_64 (push) Waiting to run
Build on Windows / i686 (push) Waiting to run
Build on Windows / ucrt-x86_64 (push) Waiting to run
Build on Windows / x86_64 (push) Waiting to run
Build on Windows / CMake clang-x86_64 (push) Waiting to run
Build on Windows / CMake i686 (push) Waiting to run
Build on Windows / CMake ucrt-x86_64 (push) Waiting to run
Build on Windows / CMake x86_64 (push) Waiting to run
Build on Windows / XP (push) Waiting to run
Build on Ubuntu / Make with USE_UPNP=no (push) Waiting to run
Build on Ubuntu / Make with USE_UPNP=yes (push) Waiting to run
Build on Ubuntu / CMake with -DWITH_UPNP=OFF (push) Waiting to run
Build on Ubuntu / CMake with -DWITH_UPNP=ON (push) Waiting to run
Build containers / Building container for linux/386 (push) Waiting to run
Build containers / Building container for linux/amd64 (push) Waiting to run
Build containers / Building container for linux/arm64 (push) Waiting to run
Build containers / Building container for linux/arm/v7 (push) Waiting to run
Build containers / Pushing merged manifest (push) Blocked by required conditions
This commit is contained in:
parent
2fafca1571
commit
49569d36e5
1 changed files with 11 additions and 7 deletions
|
@ -250,28 +250,32 @@ namespace client
|
||||||
char * separator = strchr (m_Buffer, ' ');
|
char * separator = strchr (m_Buffer, ' ');
|
||||||
if (separator)
|
if (separator)
|
||||||
{
|
{
|
||||||
|
size_t l = 0;
|
||||||
separator = strchr (separator + 1, ' ');
|
separator = strchr (separator + 1, ' ');
|
||||||
if (separator)
|
if (separator)
|
||||||
|
{
|
||||||
*separator = 0;
|
*separator = 0;
|
||||||
|
l = eol - separator - 1;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
separator = eol;
|
separator = eol;
|
||||||
|
|
||||||
if (!strcmp (m_Buffer, SAM_SESSION_CREATE))
|
if (!strcmp (m_Buffer, SAM_SESSION_CREATE))
|
||||||
ProcessSessionCreate ({ separator + 1, bytes_transferred - (separator - m_Buffer) - 1 });
|
ProcessSessionCreate ({ separator + 1, l });
|
||||||
else if (!strcmp (m_Buffer, SAM_STREAM_CONNECT))
|
else if (!strcmp (m_Buffer, SAM_STREAM_CONNECT))
|
||||||
ProcessStreamConnect (separator + 1, bytes_transferred - (separator - m_Buffer) - 1, bytes_transferred - (eol - m_Buffer) - 1);
|
ProcessStreamConnect (separator + 1, bytes_transferred - (separator - m_Buffer) - 1, bytes_transferred - (eol - m_Buffer) - 1);
|
||||||
else if (!strcmp (m_Buffer, SAM_STREAM_ACCEPT))
|
else if (!strcmp (m_Buffer, SAM_STREAM_ACCEPT))
|
||||||
ProcessStreamAccept ({ separator + 1, bytes_transferred - (separator - m_Buffer) - 1 });
|
ProcessStreamAccept ({ separator + 1, l });
|
||||||
else if (!strcmp (m_Buffer, SAM_STREAM_FORWARD))
|
else if (!strcmp (m_Buffer, SAM_STREAM_FORWARD))
|
||||||
ProcessStreamForward ({ separator + 1, bytes_transferred - (separator - m_Buffer) - 1 });
|
ProcessStreamForward ({ separator + 1, l });
|
||||||
else if (!strcmp (m_Buffer, SAM_DEST_GENERATE))
|
else if (!strcmp (m_Buffer, SAM_DEST_GENERATE))
|
||||||
ProcessDestGenerate ({ separator + 1, bytes_transferred - (separator - m_Buffer) - 1 });
|
ProcessDestGenerate ({ separator + 1, l });
|
||||||
else if (!strcmp (m_Buffer, SAM_NAMING_LOOKUP))
|
else if (!strcmp (m_Buffer, SAM_NAMING_LOOKUP))
|
||||||
ProcessNamingLookup ({ separator + 1, bytes_transferred - (separator - m_Buffer) - 1 });
|
ProcessNamingLookup ({ separator + 1, l });
|
||||||
else if (!strcmp (m_Buffer, SAM_SESSION_ADD))
|
else if (!strcmp (m_Buffer, SAM_SESSION_ADD))
|
||||||
ProcessSessionAdd ({ separator + 1, bytes_transferred - (separator - m_Buffer) - 1 });
|
ProcessSessionAdd ({ separator + 1, l });
|
||||||
else if (!strcmp (m_Buffer, SAM_SESSION_REMOVE))
|
else if (!strcmp (m_Buffer, SAM_SESSION_REMOVE))
|
||||||
ProcessSessionRemove ({ separator + 1, bytes_transferred - (separator - m_Buffer) - 1 });
|
ProcessSessionRemove ({ separator + 1, l });
|
||||||
else if (!strcmp (m_Buffer, SAM_DATAGRAM_SEND) || !strcmp (m_Buffer, SAM_RAW_SEND))
|
else if (!strcmp (m_Buffer, SAM_DATAGRAM_SEND) || !strcmp (m_Buffer, SAM_RAW_SEND))
|
||||||
{
|
{
|
||||||
size_t len = bytes_transferred - (separator - m_Buffer) - 1;
|
size_t len = bytes_transferred - (separator - m_Buffer) - 1;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue