mirror of
https://github.com/moparisthebest/curl
synced 2025-03-11 07:39:50 -04:00
Made a few more functions static with the protocol handler table in place.
This commit is contained in:
parent
a9f47b9364
commit
61ffcd7815
@ -95,6 +95,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
static CURLcode Curl_file(struct connectdata *, bool *done);
|
static CURLcode Curl_file(struct connectdata *, bool *done);
|
||||||
|
static CURLcode Curl_file_done(struct connectdata *conn,
|
||||||
|
CURLcode status, bool premature);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* FILE scheme handler.
|
* FILE scheme handler.
|
||||||
@ -193,8 +195,8 @@ CURLcode Curl_file_connect(struct connectdata *conn)
|
|||||||
return CURLE_OK;
|
return CURLE_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
CURLcode Curl_file_done(struct connectdata *conn,
|
static CURLcode Curl_file_done(struct connectdata *conn,
|
||||||
CURLcode status, bool premature)
|
CURLcode status, bool premature)
|
||||||
{
|
{
|
||||||
struct FILEPROTO *file = conn->data->reqdata.proto.file;
|
struct FILEPROTO *file = conn->data->reqdata.proto.file;
|
||||||
(void)status; /* not used */
|
(void)status; /* not used */
|
||||||
|
@ -26,7 +26,6 @@
|
|||||||
#ifndef CURL_DISABLE_FILE
|
#ifndef CURL_DISABLE_FILE
|
||||||
extern const struct Curl_handler Curl_handler_file;
|
extern const struct Curl_handler Curl_handler_file;
|
||||||
|
|
||||||
CURLcode Curl_file_done(struct connectdata *, CURLcode, bool premature);
|
|
||||||
CURLcode Curl_file_connect(struct connectdata *);
|
CURLcode Curl_file_connect(struct connectdata *);
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
@ -146,7 +146,9 @@ static int Curl_ftp_getsock(struct connectdata *conn,
|
|||||||
static CURLcode Curl_ftp_doing(struct connectdata *conn,
|
static CURLcode Curl_ftp_doing(struct connectdata *conn,
|
||||||
bool *dophase_done);
|
bool *dophase_done);
|
||||||
static CURLcode Curl_ftp_setup_connection(struct connectdata * conn);
|
static CURLcode Curl_ftp_setup_connection(struct connectdata * conn);
|
||||||
|
#ifdef USE_SSL
|
||||||
static CURLcode Curl_ftps_setup_connection(struct connectdata * conn);
|
static CURLcode Curl_ftps_setup_connection(struct connectdata * conn);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* easy-to-use macro: */
|
/* easy-to-use macro: */
|
||||||
#define FTPSENDF(x,y,z) if ((result = Curl_ftpsendf(x,y,z)) != CURLE_OK) \
|
#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;
|
return CURLE_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef USE_SSL
|
||||||
static CURLcode Curl_ftps_setup_connection(struct connectdata * conn)
|
static CURLcode Curl_ftps_setup_connection(struct connectdata * conn)
|
||||||
{
|
{
|
||||||
struct SessionHandle *data = conn->data;
|
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;
|
conn->ssl[SECONDARYSOCKET].use = data->set.ftp_ssl != CURLUSESSL_CONTROL;
|
||||||
return Curl_ftp_setup_connection(conn);
|
return Curl_ftp_setup_connection(conn);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif /* CURL_DISABLE_FTP */
|
#endif /* CURL_DISABLE_FTP */
|
||||||
|
13
lib/url.c
13
lib/url.c
@ -169,6 +169,10 @@ static struct SessionHandle* gethandleathead(struct curl_llist *pipeline);
|
|||||||
static void flush_cookies(struct SessionHandle *data, int cleanup);
|
static void flush_cookies(struct SessionHandle *data, int cleanup);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef CURL_DISABLE_VERBOSE_STRINGS
|
||||||
|
#define verboseconnect(x) do { } while (0)
|
||||||
|
#endif
|
||||||
|
|
||||||
#define MAX_PIPELINE_LENGTH 5
|
#define MAX_PIPELINE_LENGTH 5
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -262,7 +266,7 @@ static const struct Curl_handler * const protocols[] = {
|
|||||||
* Dummy handler for undefined protocol schemes.
|
* Dummy handler for undefined protocol schemes.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const struct Curl_handler Curl_handler_dummy = {
|
static const struct Curl_handler Curl_handler_dummy = {
|
||||||
"<no protocol>", /* scheme */
|
"<no protocol>", /* scheme */
|
||||||
NULL, /* setup_connection */
|
NULL, /* setup_connection */
|
||||||
NULL, /* do_it */
|
NULL, /* do_it */
|
||||||
@ -278,10 +282,6 @@ const struct Curl_handler Curl_handler_dummy = {
|
|||||||
0 /* protocol */
|
0 /* protocol */
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef CURL_DISABLE_VERBOSE_STRINGS
|
|
||||||
#define verboseconnect(x) do { } while (0)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void Curl_safefree(void *ptr)
|
void Curl_safefree(void *ptr)
|
||||||
{
|
{
|
||||||
if(ptr)
|
if(ptr)
|
||||||
@ -3579,7 +3579,8 @@ static CURLcode CreateConnection(struct SessionHandle *data,
|
|||||||
|
|
||||||
result = setup_range(data);
|
result = setup_range(data);
|
||||||
if(result) {
|
if(result) {
|
||||||
Curl_file_done(conn, result, FALSE);
|
if(conn->handler->done)
|
||||||
|
result = conn->handler->done(conn, result, FALSE);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user