mirror of
https://github.com/SoftEtherVPN/SoftEtherVPN.git
synced 2024-12-26 01:59:53 +03:00
Cedar: move buffer limit handling from ProtoHandleConnection() to protocol implementation
This allows greater control, required by SSTP: the limit only applies to data packets.
This commit is contained in:
parent
eb5150a002
commit
19dbdf46be
@ -431,8 +431,6 @@ bool ProtoHandleConnection(PROTO *proto, SOCK *sock, const char *protocol)
|
||||
}
|
||||
}
|
||||
|
||||
impl->BufferLimit(impl_data, FifoSize(send_fifo) > MAX_BUFFERING_PACKET_SIZE);
|
||||
|
||||
if (stop)
|
||||
{
|
||||
// Error or disconnection occurs
|
||||
|
@ -30,7 +30,6 @@ typedef struct PROTO_IMPL
|
||||
bool (*IsPacketForMe)(const PROTO_MODE mode, const UCHAR *data, const UINT size);
|
||||
bool (*ProcessData)(void *param, TCP_RAW_DATA *in, FIFO *out);
|
||||
bool (*ProcessDatagrams)(void *param, LIST *in, LIST *out);
|
||||
void (*BufferLimit)(void *param, const bool reached);
|
||||
} PROTO_IMPL;
|
||||
|
||||
typedef struct PROTO_SESSION
|
||||
|
@ -23,8 +23,7 @@ PROTO_IMPL *OvsGetProtoImpl()
|
||||
OvsName,
|
||||
OvsIsPacketForMe,
|
||||
OvsProcessData,
|
||||
OvsProcessDatagrams,
|
||||
OvsBufferLimit,
|
||||
OvsProcessDatagrams
|
||||
};
|
||||
|
||||
return &impl;
|
||||
@ -185,6 +184,8 @@ bool OvsProcessData(void *param, TCP_RAW_DATA *in, FIFO *out)
|
||||
return false;
|
||||
}
|
||||
|
||||
server->SupressSendPacket = FifoSize(out) > MAX_BUFFERING_PACKET_SIZE;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -229,16 +230,6 @@ bool OvsProcessDatagrams(void *param, LIST *in, LIST *out)
|
||||
return true;
|
||||
}
|
||||
|
||||
void OvsBufferLimit(void *param, const bool reached)
|
||||
{
|
||||
if (param == NULL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
((OPENVPN_SERVER *)param)->SupressSendPacket = reached;
|
||||
}
|
||||
|
||||
// Write the OpenVPN log
|
||||
void OvsLog(OPENVPN_SERVER *s, OPENVPN_SESSION *se, OPENVPN_CHANNEL *c, char *name, ...)
|
||||
{
|
||||
|
@ -215,7 +215,6 @@ char *OvsName();
|
||||
bool OvsIsPacketForMe(const PROTO_MODE mode, const UCHAR *data, const UINT size);
|
||||
bool OvsProcessData(void *param, TCP_RAW_DATA *in, FIFO *out);
|
||||
bool OvsProcessDatagrams(void *param, LIST *in, LIST *out);
|
||||
void OvsBufferLimit(void *param, const bool reached);
|
||||
bool OvsIsOk(void *param);
|
||||
UINT OvsEstablishedSessions(void *param);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user