From aa02dc1ed80ad3f48f40fcf17e15b243fdba51ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Thu, 20 Nov 2014 17:28:18 +0100 Subject: [PATCH] Add support for cleanly exiting ssl_server2 Useful for memory testing --- programs/ssl/ssl_server2.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/programs/ssl/ssl_server2.c b/programs/ssl/ssl_server2.c index 3cc3f8ab7..33d56ceae 100644 --- a/programs/ssl/ssl_server2.c +++ b/programs/ssl/ssl_server2.c @@ -653,6 +653,12 @@ reset: len = ret; printf( " %d bytes read\n\n%s", len, (char *) buf ); + if( len >= 10 && memcmp( buf, "SERVERQUIT", 10 ) == 0 ) + { + ret = 0; + goto exit; + } + if( ret > 0 ) break; }