Made a few more functions static with the protocol handler table in place.
authorDan Fandrich <dan@coneharvesters.com>
Sat, 13 Oct 2007 00:47:53 +0000 (00:47 +0000)
committerDan Fandrich <dan@coneharvesters.com>
Sat, 13 Oct 2007 00:47:53 +0000 (00:47 +0000)
lib/file.c
lib/file.h
lib/ftp.c
lib/url.c

index dcee427..d8a3420 100644 (file)
@@ -95,6 +95,8 @@
  */
 
 static CURLcode Curl_file(struct connectdata *, bool *done);
+static CURLcode Curl_file_done(struct connectdata *conn,
+                               CURLcode status, bool premature);
 
 /*
  * FILE scheme handler.
@@ -193,8 +195,8 @@ CURLcode Curl_file_connect(struct connectdata *conn)
   return CURLE_OK;
 }
 
-CURLcode Curl_file_done(struct connectdata *conn,
-                        CURLcode status, bool premature)
+static CURLcode Curl_file_done(struct connectdata *conn,
+                               CURLcode status, bool premature)
 {
   struct FILEPROTO *file = conn->data->reqdata.proto.file;
   (void)status; /* not used */
index 227c0d1..7f338af 100644 (file)
@@ -26,7 +26,6 @@
 #ifndef CURL_DISABLE_FILE
 extern const struct Curl_handler Curl_handler_file;
 
-CURLcode Curl_file_done(struct connectdata *, CURLcode, bool premature);
 CURLcode Curl_file_connect(struct connectdata *);
 #endif
 #endif
index ba05a50..1cdf23c 100644 (file)
--- a/lib/ftp.c
+++ b/lib/ftp.c
@@ -146,7 +146,9 @@ static int Curl_ftp_getsock(struct connectdata *conn,
 static CURLcode Curl_ftp_doing(struct connectdata *conn,
                                bool *dophase_done);
 static CURLcode Curl_ftp_setup_connection(struct connectdata * conn);
+#ifdef USE_SSL
 static CURLcode Curl_ftps_setup_connection(struct connectdata * conn);
+#endif
 
 /* easy-to-use macro: */
 #define FTPSENDF(x,y,z)    if ((result = Curl_ftpsendf(x,y,z)) != CURLE_OK) \
@@ -4159,6 +4161,7 @@ static CURLcode Curl_ftp_setup_connection(struct connectdata * conn)
   return CURLE_OK;
 }
 
+#ifdef USE_SSL
 static CURLcode Curl_ftps_setup_connection(struct connectdata * conn)
 {
   struct SessionHandle *data = conn->data;
@@ -4166,4 +4169,6 @@ static CURLcode Curl_ftps_setup_connection(struct connectdata * conn)
   conn->ssl[SECONDARYSOCKET].use = data->set.ftp_ssl != CURLUSESSL_CONTROL;
   return Curl_ftp_setup_connection(conn);
 }
+#endif
+
 #endif /* CURL_DISABLE_FTP */
index 047df97..549e640 100644 (file)
--- a/lib/url.c
+++ b/lib/url.c
@@ -169,6 +169,10 @@ static struct SessionHandle* gethandleathead(struct curl_llist *pipeline);
 static void flush_cookies(struct SessionHandle *data, int cleanup);
 #endif
 
+#ifdef CURL_DISABLE_VERBOSE_STRINGS
+#define verboseconnect(x)  do { } while (0)
+#endif
+
 #define MAX_PIPELINE_LENGTH 5
 
 /*
@@ -262,7 +266,7 @@ static const struct Curl_handler * const protocols[] = {
  * Dummy handler for undefined protocol schemes.
  */
 
-const struct Curl_handler Curl_handler_dummy = {
+static const struct Curl_handler Curl_handler_dummy = {
   "<no protocol>",                      /* scheme */
   NULL,                                 /* setup_connection */
   NULL,                                 /* do_it */
@@ -278,10 +282,6 @@ const struct Curl_handler Curl_handler_dummy = {
   0                                     /* protocol */
 };
 
-#ifdef CURL_DISABLE_VERBOSE_STRINGS
-#define verboseconnect(x)  do { } while (0)
-#endif
-
 void Curl_safefree(void *ptr)
 {
   if(ptr)
@@ -3579,7 +3579,8 @@ static CURLcode CreateConnection(struct SessionHandle *data,
 
       result = setup_range(data);
       if(result) {
-        Curl_file_done(conn, result, FALSE);
+        if(conn->handler->done)
+          result = conn->handler->done(conn, result, FALSE);
         return result;
       }