sctp_status: server side should also receive msg_cnt times
PATCH 1/1 sctp_status: server side should also receive msg_cnt times
As client side send msg_cnt times for each repeat. Server will exit too early if we only receive one time for each repeat and leave client keep sent, which makes client could not exit normally
--- src/apps/sctp_status.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
src/apps/sctp_status.c +6 -1
@@ -547,6 +547,8 @@ int receive_r(int sk) }/* receive_r () */ void server (int sk) { +int i; +if (max_msgsize >DEFAULT_MAX_WINDOW ) {if (setsockopt (sk,IPPROTO_SCTP ,SO_RCVBUF , &max_msgsize,sizeof (max_msgsize)) <0 ) {
@@ -555,7 +557,10 @@ void server(int sk) { } } -receive_r (sk); +for (i =0 ; i < msg_cnt; i++) { +receive_r (sk); +DEBUG_PRINT (DEBUG_MIN ,"count %d\n" , i+1 ); + } }/* server() */ void *build_msg (int len) {
Signature · 1 line
1.8.1.4
Quoted 37 lines · Hangbin Liu
As client side send
msg_cnttimes for each repeat. Server will exit too early if we only receive one time for each repeat and leave client keep sent, which makes client could not exit normallySigned-off-by Hangbin Liu <[email protected]>--- src/apps/sctp_status.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)src/apps/sctp_status.c +6
-1@@ -547,6 +547,8 @@ int receive_r(int sk) }/* receive_r () */ void server (int sk) { +int i; +if (max_msgsize >DEFAULT_MAX_WINDOW ) {if (setsockopt (sk,IPPROTO_SCTP ,SO_RCVBUF , &max_msgsize,sizeof (max_msgsize)) <0 ) {@@ -555,7 +557,10 @@ void server(int sk) { } } -receive_r (sk); +for (i =0 ; i < msg_cnt; i++) { +receive_r (sk); +DEBUG_PRINT (DEBUG_MIN ,"count %d\n" , i+1 ); + } }/* server() */ void *build_msg (int len) {Signature · 1 line
1.8.1.4
How about this patch?
Signature · 2 lines
Thanks & Best Regards Hangbin Liu <[email protected]>
Quoted 1 line · Hangbin Liu
How about this patch?
Having a look at this today, and also at the issue you described.
Quoted 5 lines · Hangbin Liu
As client side send
msg_cnttimes for each repeat. Server will exit too early if we only receive one time for each repeat and leave client keep sent, which makes client could not exit normallySigned-off-by Hangbin Liu <[email protected]>
Ok, applied, thanks.