From: Xiaoqiang C. <fe...@gm...> - 2013-08-28 16:09:31
|
1. On network error, return NULL rather than an empty return statement to conform with function signature. 2. SSL_OP_NO_COMPRESSION is only available for openssl ver >=0.9.8 so check it before adding the flag. ref: https://github.com/mxcl/homebrew/pull/22116 diff --git a/tcp.c b/tcp.c index a541e45..943a655 100644 --- a/tcp.c +++ b/tcp.c @@ -193,7 +193,7 @@ tcp_recv(STREAM s, uint32 length) int rcvd = 0, ssl_err; if (g_network_error == True) - return; + return NULL; if (s == NULL) { @@ -318,7 +318,9 @@ tcp_tls_connect(void) } options = 0; +#ifdef SSL_OP_NO_COMPRESSION options |= SSL_OP_NO_COMPRESSION; +#endif options |= SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS; SSL_CTX_set_options(g_ssl_ctx, options); } |