From 61ffcd781599ac9a9f85b92f4be10588f2015721 Mon Sep 17 00:00:00 2001 From: Dan Fandrich Date: Sat, 13 Oct 2007 00:47:53 +0000 Subject: Made a few more functions static with the protocol handler table in place. --- lib/file.c | 6 ++++-- lib/file.h | 1 - lib/ftp.c | 5 +++++ lib/url.c | 13 +++++++------ 4 files changed, 16 insertions(+), 9 deletions(-) (limited to 'lib') diff --git a/lib/file.c b/lib/file.c index dcee427ee..d8a3420c0 100644 --- a/lib/file.c +++ b/lib/file.c @@ -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 */ diff --git a/lib/file.h b/lib/file.h index 227c0d181..7f338af1a 100644 --- a/lib/file.h +++ b/lib/file.h @@ -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 diff --git a/lib/ftp.c b/lib/ftp.c index ba05a507d..1cdf23cdb 100644 --- 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 */ diff --git a/lib/url.c b/lib/url.c index 047df97a9..549e640b3 100644 --- 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 = { "", /* 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; } -- cgit v1.2.3