From: Dr. Stephen Henson Date: Thu, 6 Feb 2014 13:57:26 +0000 (+0000) Subject: Return previous compression methods when setting them. X-Git-Tag: master-post-reformat~970 X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff_plain;h=b45e874d7c4a8fdac7ec10cff43f21d02e75d511;hp=c53a5308a5670a685bc47fd7f66d715ad311dff2;ds=sidebyside Return previous compression methods when setting them. --- diff --git a/ssl/ssl.h b/ssl/ssl.h index 4f38c3ba46..13e7b7218f 100644 --- a/ssl/ssl.h +++ b/ssl/ssl.h @@ -2503,7 +2503,7 @@ const COMP_METHOD *SSL_get_current_compression(SSL *s); const COMP_METHOD *SSL_get_current_expansion(SSL *s); const char *SSL_COMP_get_name(const COMP_METHOD *comp); STACK_OF(SSL_COMP) *SSL_COMP_get_compression_methods(void); -void SSL_COMP_set0_compression_methods(STACK_OF(SSL_COMP) *meths); +STACK_OF(SSL_COMP) *SSL_COMP_set0_compression_methods(STACK_OF(SSL_COMP) *meths); int SSL_COMP_add_compression_method(int id,COMP_METHOD *cm); #else const void *SSL_get_current_compression(SSL *s); diff --git a/ssl/ssl_ciph.c b/ssl/ssl_ciph.c index 33b7d08910..1927969a76 100644 --- a/ssl/ssl_ciph.c +++ b/ssl/ssl_ciph.c @@ -1892,9 +1892,11 @@ STACK_OF(SSL_COMP) *SSL_COMP_get_compression_methods(void) return(ssl_comp_methods); } -void SSL_COMP_set0_compression_methods(STACK_OF(SSL_COMP) *meths) +STACK_OF(SSL_COMP) *SSL_COMP_set0_compression_methods(STACK_OF(SSL_COMP) *meths) { + STACK_OF(SSL_COMP) *old_meths = ssl_comp_methods; ssl_comp_methods = meths; + return old_meths; } int SSL_COMP_add_compression_method(int id, COMP_METHOD *cm)