mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
Clean up SOCKS a bit
This commit is contained in:
parent
c9576dcdbe
commit
17ccaab792
2 changed files with 6 additions and 28 deletions
11
SOCKS.cpp
11
SOCKS.cpp
|
@ -4,17 +4,12 @@
|
|||
#include "Destination.h"
|
||||
#include "ClientContext.h"
|
||||
#include "I2PEndian.h"
|
||||
#include <cstring>
|
||||
#include <cassert>
|
||||
#include <vector>
|
||||
|
||||
namespace i2p
|
||||
{
|
||||
namespace proxy
|
||||
{
|
||||
const uint8_t socks_leaseset_timeout = 10;
|
||||
const uint8_t socks_timeout = 60;
|
||||
|
||||
void SOCKSHandler::AsyncSockRead()
|
||||
{
|
||||
LogPrint(eLogDebug,"--- SOCKS async sock read");
|
||||
|
@ -129,10 +124,6 @@ namespace proxy
|
|||
}
|
||||
}
|
||||
|
||||
const size_t socks_hostname_size = 1024;
|
||||
const size_t socks_ident_size = 1024;
|
||||
const size_t destb32_len = 52;
|
||||
|
||||
std::size_t SOCKSHandler::HandleData(uint8_t *sock_buff, std::size_t len)
|
||||
{
|
||||
assert(len); // This should always be called with a least a byte left to parse
|
||||
|
@ -228,7 +219,7 @@ namespace proxy
|
|||
m_need_more = false;
|
||||
return rv;
|
||||
}
|
||||
if (m_destination.size() > HOST_NAME_MAX) {
|
||||
if (m_destination.size() > max_socks_hostname_size) {
|
||||
LogPrint(eLogError,"--- SOCKS4a destination is too large ");
|
||||
SocksRequestFailed();
|
||||
return 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue