From e9ecf1449d33479c40e075043489dd84dabcc0dd Mon Sep 17 00:00:00 2001 From: liuxueli Date: Wed, 23 Jun 2021 14:34:46 +0800 Subject: [PATCH] =?UTF-8?q?TSG-6617:=20=E5=BC=82=E5=B8=B8=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=8C=85=E8=BF=94=E5=9B=9E-1=EF=BC=8C=E5=AF=BC?= =?UTF-8?q?=E8=87=B4=E5=86=85=E5=AD=98=E6=B3=84=E6=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/gquic_process.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/gquic_process.c b/src/gquic_process.c index 4f0b721..cee031e 100644 --- a/src/gquic_process.c +++ b/src/gquic_process.c @@ -515,7 +515,7 @@ enum _QUIC_VERSION is_quic_protocol(struct streaminfo *pstream, struct _quic_con int parse_extension_tag(struct streaminfo *pstream, struct _quic_stream **quic_stream, void *a_packet, char *payload, int payload_len, int *used_len, int tag_num) { - int ret=0,tag_used_num=0; + int tag_used_num=0; int tag_type,skip_tsg=0; int total_tag_len=0,tag_len=0; int tag_offset_end=0,pre_tag_offset_end=0; @@ -606,7 +606,7 @@ int parse_extension_tag(struct streaminfo *pstream, struct _quic_stream **quic_s *used_len += total_tag_len; - return ret; + return 0; } int gquic_frame_type_ack(struct streaminfo *pstream, struct _quic_context* _context, char *payload, int payload_len, int *used_len, char frame_type, void *a_packet) @@ -662,6 +662,7 @@ int gquic_frame_type_ack(struct streaminfo *pstream, struct _quic_context* _cont int gquic_frame_type_stream(struct streaminfo *pstream, struct _quic_context* _context, char *payload, int payload_len, int *used_len, char frame_type, void *a_packet) { int ret=0; + char state=APP_STATE_GIVEME; unsigned short tag_num = 0; unsigned int stream_id, message_tag; @@ -680,28 +681,28 @@ int gquic_frame_type_stream(struct streaminfo *pstream, struct _quic_context* _c ret=parse_extension_tag(pstream, &(_context->quic_info.client_hello), a_packet, payload, payload_len, used_len, tag_num); if(ret>=0 && _context->call_business) { - ret=quic_callPlugins(pstream, _context, (void *)(_context->quic_info.client_hello), sizeof(void *), QUIC_CLIENT_HELLO_MASK, a_packet); + state=quic_callPlugins(pstream, _context, (void *)(_context->quic_info.client_hello), sizeof(void *), QUIC_CLIENT_HELLO_MASK, a_packet); } break; case SHLO: //MTAG_SHLO; ret=parse_extension_tag(pstream, &(_context->quic_info.server_hello), a_packet, payload, payload_len, used_len, tag_num); if(ret>=0 && _context->call_business) { - ret=quic_callPlugins(pstream, _context, (void *)(_context->quic_info.server_hello), sizeof(void *), QUIC_SERVER_HELLO_MASK, a_packet); + state=quic_callPlugins(pstream, _context, (void *)(_context->quic_info.server_hello), sizeof(void *), QUIC_SERVER_HELLO_MASK, a_packet); } break; case REJ: //MTAG_REJ; ret=parse_extension_tag(pstream, &(_context->quic_info.rejection), a_packet, payload, payload_len, used_len, tag_num); if(ret>=0 && _context->call_business) { - ret=quic_callPlugins(pstream, _context, (void *)(_context->quic_info.rejection), sizeof(void *), QUIC_REJECTION_MASK, a_packet); + state=quic_callPlugins(pstream, _context, (void *)(_context->quic_info.rejection), sizeof(void *), QUIC_REJECTION_MASK, a_packet); } break; default: break; } - return ret; + return state; } //frame type->stream->offset->data length @@ -972,7 +973,7 @@ int quic_protocol_identify(struct streaminfo *a_stream, void *a_packet, char *ou _context=(struct _quic_context *)pme; ret=quic_process(a_stream, _context, a_stream->threadnum, a_packet); - if(ret!=PROT_STATE_DROPME) + if(ret!=PROT_STATE_DROPME && _context->is_quic!=QUIC_VERSION_UNKNOWN) { if(_context->quic_info.client_hello!=NULL) {