summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author杨威 <[email protected]>2023-07-18 22:16:01 +0800
committer杨威 <[email protected]>2023-07-18 22:16:01 +0800
commitc73e024a66dc566ef4292b963974a4bf711a5da9 (patch)
treed9994a5544cc98ee6f6034bd295c74cc4a863ead
parent00ecffad63c7be945ecca6e074dfe7b3083399b4 (diff)
✨ feat(stream_set_single_stream_timeout): 移除新设置超时时间必须大于已有的限制v4.3.16
-rw-r--r--src/dealpkt/stream_manage.c50
1 files changed, 17 insertions, 33 deletions
diff --git a/src/dealpkt/stream_manage.c b/src/dealpkt/stream_manage.c
index df88ea3..a6bb6a6 100644
--- a/src/dealpkt/stream_manage.c
+++ b/src/dealpkt/stream_manage.c
@@ -219,49 +219,33 @@ int stream_set_single_stream_timeout(const struct streaminfo *pstream,unsigned s
if(OP_STATE_CLOSE == pstream->opstate){/* ��ǰ���ѽ���, ���賬ʱҲû�������� */
return -1;
}
-
- if((0 == pstream_pr->timeout) /* 0Ϊ��δ���ù� */
- || (timeout >= pstream_pr->timeout)) /* �����õij�ʱֵ������ڵ��ڵ�ǰֵ */
- {
- /* TODO 1, �������ƶ���LRU��ʱ�����ʵ���λ��, ��head��ʼ��ʣ��ij�ʱʱ������
- NOTE:
- ��Ϊ����ȫ�ֶ�û������ʱ, ����Ե����������˳�ʱ, ��ô����Ӧ���ƶ���LRUĩβ,
- ����del_stream_by_time()����ֻ���ж���ĩβ�����Ƿ�ʱ, �����ж���������.
- ����: ������Ϊ�˱��������١�����ʱ�䳤����, ������������, ���ܳ�����������%p;
- */
- pindex = sapp_get_struct_header(pstream_pr, struct streamindex, stream);
-
- if(STREAM_TYPE_UDP==pstream->type)
+ pindex = sapp_get_struct_header(pstream_pr, struct streamindex, stream);
+ if (STREAM_TYPE_UDP == pstream->type)
+ {
+ if (pstream_pr->timeout == udp_reset_time)
{
- if(timeout < udp_reset_time){ /* �����ȫ��Ĭ��ֵ��, �Ҳ��ܱ�֮ǰ���õ�С */
- return -1;
- }
- if(pstream_pr->timeout == udp_reset_time){
- /* �������������ó�ʱʱ��, ��ǰ����һ�����ó�ʱʱ���¼���� */
- sapp_global_mthread[pstream->threadnum].udp_stream_special_timeout_num++;
- }
+ /* �������������ó�ʱʱ��, ��ǰ����һ�����ó�ʱʱ���¼���� */
+ sapp_global_mthread[pstream->threadnum].udp_stream_special_timeout_num++;
}
- else if (STREAM_TYPE_TCP==pstream->type)
+ }
+ else if (STREAM_TYPE_TCP == pstream->type)
+ {
+ if (pstream_pr->timeout == link_default_nopkt_time)
{
- if(timeout < link_default_nopkt_time){ /* �����ȫ��Ĭ��ֵ��, �Ҳ��ܱ�֮ǰ���õ�С */
- return -1;
- }
- if(pstream_pr->timeout == link_default_nopkt_time){
- /* �������������ó�ʱʱ��, ��ǰ����һ�����ó�ʱʱ���¼���� */
- sapp_global_mthread[pstream->threadnum].tcp_stream_special_timeout_num++;
- }
- }else{
- goto err; /* ��֧��TCP��UDP�� */
+ /* �������������ó�ʱʱ��, ��ǰ����һ�����ó�ʱʱ���¼���� */
+ sapp_global_mthread[pstream->threadnum].tcp_stream_special_timeout_num++;
}
-
}
else
{
- goto err;
+ goto err; /* ��֧��TCP��UDP�� */
}
- stream_timeout_shift_lrulist(pindex, timeout);
+ if(pstream_pr->packet_io_context != 0)
+ {
+ stream_timeout_shift_lrulist(pindex, timeout);
+ }
pstream_pr->timeout=timeout;
return ret;