From b903186fa0189ff241d756d25d07fdfe9885ae49 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 20 Apr 2011 15:17:42 +0200 Subject: source cleanup: unify look, style and indent levels By the use of a the new lib/checksrc.pl script that checks that our basic source style rules are followed. --- lib/share.c | 39 +++++++++++++++++++-------------------- 1 file changed, 19 insertions(+), 20 deletions(-) (limited to 'lib/share.c') diff --git a/lib/share.c b/lib/share.c index 146228551..33dcecf4c 100644 --- a/lib/share.c +++ b/lib/share.c @@ -96,32 +96,31 @@ curl_share_setopt(CURLSH *sh, CURLSHoption option, ...) /* this is a type this share will no longer share */ type = va_arg(param, int); share->specifier &= ~(1<hostcache) { - Curl_hash_destroy(share->hostcache); - share->hostcache = NULL; - } - break; + switch( type ) { + case CURL_LOCK_DATA_DNS: + if(share->hostcache) { + Curl_hash_destroy(share->hostcache); + share->hostcache = NULL; + } + break; #if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_COOKIES) - case CURL_LOCK_DATA_COOKIE: - if(share->cookies) { - Curl_cookie_cleanup(share->cookies); - share->cookies = NULL; - } - break; + case CURL_LOCK_DATA_COOKIE: + if(share->cookies) { + Curl_cookie_cleanup(share->cookies); + share->cookies = NULL; + } + break; #endif /* CURL_DISABLE_HTTP */ - case CURL_LOCK_DATA_SSL_SESSION: - break; + case CURL_LOCK_DATA_SSL_SESSION: + break; - case CURL_LOCK_DATA_CONNECT: - break; + case CURL_LOCK_DATA_CONNECT: + break; - default: - return CURLSHE_BAD_OPTION; + default: + return CURLSHE_BAD_OPTION; } break; -- cgit v1.2.3