]> granicus.if.org Git - curl/commitdiff
vtls: Fixed compilation warning and an ignored return code
authorSteve Holme <steve_holme@hotmail.com>
Sun, 28 Dec 2014 17:21:02 +0000 (17:21 +0000)
committerSteve Holme <steve_holme@hotmail.com>
Sun, 28 Dec 2014 17:33:01 +0000 (17:33 +0000)
curl_schannel.h:123: warning: right-hand operand of comma expression
                     has no effect

Some instances of the curlssl_close_all() function were declared with a
void return type whilst others as int. The schannel version returned
CURLE_NOT_BUILT_IN and others simply returned zero, but in all cases the
return code was ignored by the calling function Curl_ssl_close_all().

For the time being and to keep the internal API consistent, changed all
declarations to use a void return type.

To reduce code we might want to consider removing the unimplemented
versions and use a void #define like schannel does.

lib/vtls/curl_schannel.h
lib/vtls/gskit.c
lib/vtls/gskit.h
lib/vtls/nss.c
lib/vtls/nssg.h
lib/vtls/openssl.c
lib/vtls/openssl.h

index d4a41440ab91d36325a0cf8ed622ac77f7c31cc4..417dd732f397911808a0388c41f0e9a1df71c25a 100644 (file)
@@ -120,7 +120,7 @@ int Curl_schannel_random(unsigned char *entropy, size_t length);
 #define curlssl_connect Curl_schannel_connect
 #define curlssl_connect_nonblocking Curl_schannel_connect_nonblocking
 #define curlssl_session_free Curl_schannel_session_free
-#define curlssl_close_all(x) (x=x, CURLE_NOT_BUILT_IN)
+#define curlssl_close_all(x) ((void)x)
 #define curlssl_close Curl_schannel_close
 #define curlssl_shutdown Curl_schannel_shutdown
 #define curlssl_set_engine(x,y) (x=x, y=y, CURLE_NOT_BUILT_IN)
index 0d133107ba55ae477e40018309b09251fbbc9aff..ac05f05bb0eee97dfe79ea0e5e1e6b4e0b52edad 100644 (file)
@@ -986,11 +986,10 @@ void Curl_gskit_close(struct connectdata *conn, int sockindex)
 }
 
 
-int Curl_gskit_close_all(struct SessionHandle *data)
+void Curl_gskit_close_all(struct SessionHandle *data)
 {
   /* Unimplemented. */
   (void) data;
-  return 0;
 }
 
 
index fc1c45ccb198a75ef26cbc662c7a2a73cdd7b464..baec82323ad277ef2180f1e5c55814aa5c255a18 100644 (file)
@@ -36,7 +36,7 @@ CURLcode Curl_gskit_connect(struct connectdata * conn, int sockindex);
 CURLcode Curl_gskit_connect_nonblocking(struct connectdata * conn,
                                         int sockindex, bool * done);
 void Curl_gskit_close(struct connectdata *conn, int sockindex);
-int Curl_gskit_close_all(struct SessionHandle * data);
+void Curl_gskit_close_all(struct SessionHandle * data);
 int Curl_gskit_shutdown(struct connectdata * conn, int sockindex);
 
 size_t Curl_gskit_version(char * buffer, size_t size);
index d05b36d5f49b25166680c34d337d7347fa9dbe1d..dd83a9d684a12448e867ae1fcae9eaed114c8d45 100644 (file)
@@ -1228,10 +1228,9 @@ void Curl_nss_close(struct connectdata *conn, int sockindex)
  * This function is called when the 'data' struct is going away. Close
  * down everything and free all resources!
  */
-int Curl_nss_close_all(struct SessionHandle *data)
+void Curl_nss_close_all(struct SessionHandle *data)
 {
   (void)data;
-  return 0;
 }
 
 /* return true if NSS can provide error code (and possibly msg) for the
index f6062f317180ff6f03253bffdef69a14e9a70753..40b937524d837efc4133331d36a21b0d5ee7969b 100644 (file)
@@ -39,7 +39,7 @@ void Curl_nss_close(struct connectdata *conn, int sockindex);
 
 /* tell NSS to close down all open information regarding connections (and
    thus session ID caching etc) */
-int Curl_nss_close_all(struct SessionHandle *data);
+void Curl_nss_close_all(struct SessionHandle *data);
 
 int Curl_nss_init(void);
 void Curl_nss_cleanup(void);
index a41447a5b98b10de85e5307344551dc8ebfab39b..a68d88eae2f948a75c856c85315a523200038911 100644 (file)
@@ -1038,7 +1038,7 @@ void Curl_ossl_session_free(void *ptr)
  * This function is called when the 'data' struct is going away. Close
  * down everything and free all resources!
  */
-int Curl_ossl_close_all(struct SessionHandle *data)
+void Curl_ossl_close_all(struct SessionHandle *data)
 {
 #ifdef HAVE_OPENSSL_ENGINE_H
   if(data->state.engine) {
@@ -1049,7 +1049,6 @@ int Curl_ossl_close_all(struct SessionHandle *data)
 #else
   (void)data;
 #endif
-  return 0;
 }
 
 static int asn1_output(const ASN1_UTCTIME *tm,
index 7eff3deeabe0e6789d9ae641baa966a9d6d1317f..9f5f3a28fb31b6664c417e61176bb759d039193c 100644 (file)
@@ -41,7 +41,7 @@ void Curl_ossl_close(struct connectdata *conn, int sockindex);
 
 /* tell OpenSSL to close down all open information regarding connections (and
    thus session ID caching etc) */
-int Curl_ossl_close_all(struct SessionHandle *data);
+void Curl_ossl_close_all(struct SessionHandle *data);
 
 /* Sets an OpenSSL engine */
 CURLcode Curl_ossl_set_engine(struct SessionHandle *data, const char *engine);