Main Page | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals

ssl.c File Reference

#include "gwlib/gwlib.h"
#include <openssl/ssl.h>

Include dependency graph for ssl.c:

Include dependency graph

Go to the source code of this file.

Functions

int SSL_smart_shutdown (SSL *ssl)


Function Documentation

int SSL_smart_shutdown SSL *  ssl  ) 
 

Definition at line 77 of file ssl.c.

References ssl.

Referenced by conn_destroy().

00078 { 
00079     int i; 
00080     int rc; 
00081  
00082     /* 
00083      * Repeat the calls, because SSL_shutdown internally dispatches through a 
00084      * little state machine. Usually only one or two interation should be 
00085      * needed, so we restrict the total number of restrictions in order to 
00086      * avoid process hangs in case the client played bad with the socket 
00087      * connection and OpenSSL cannot recognize it. 
00088      */ 
00089     rc = 0; 
00090     for (i = 0; i < 4 /* max 2x pending + 2x data = 4 */; i++) { 
00091         if ((rc = SSL_shutdown(ssl))) 
00092             break; 
00093     } 
00094     return rc; 
00095 } 

See file LICENSE for details about the license agreement for using, modifying, copying or deriving work from this software.