* Forward declarations.
*/
-static CURLcode Curl_dict(struct connectdata *conn, bool *done);
+static CURLcode dict_do(struct connectdata *conn, bool *done);
/*
* DICT protocol handler.
const struct Curl_handler Curl_handler_dict = {
"DICT", /* scheme */
ZERO_NULL, /* setup_connection */
- Curl_dict, /* do_it */
+ dict_do, /* do_it */
ZERO_NULL, /* done */
ZERO_NULL, /* do_more */
ZERO_NULL, /* connect_it */
return dictp;
}
-static CURLcode Curl_dict(struct connectdata *conn, bool *done)
+static CURLcode dict_do(struct connectdata *conn, bool *done)
{
char *word;
char *eword;
* Forward declarations.
*/
-static CURLcode Curl_file(struct connectdata *, bool *done);
-static CURLcode Curl_file_done(struct connectdata *conn,
- CURLcode status, bool premature);
-static CURLcode Curl_file_connect(struct connectdata *conn, bool *done);
+static CURLcode file_do(struct connectdata *, bool *done);
+static CURLcode file_done(struct connectdata *conn,
+ CURLcode status, bool premature);
+static CURLcode file_connect(struct connectdata *conn, bool *done);
/*
* FILE scheme handler.
const struct Curl_handler Curl_handler_file = {
"FILE", /* scheme */
ZERO_NULL, /* setup_connection */
- Curl_file, /* do_it */
- Curl_file_done, /* done */
+ file_do, /* do_it */
+ file_done, /* done */
ZERO_NULL, /* do_more */
- Curl_file_connect, /* connect_it */
+ file_connect, /* connect_it */
ZERO_NULL, /* connecting */
ZERO_NULL, /* doing */
ZERO_NULL, /* proto_getsock */
};
/*
- * Curl_file_connect() gets called from Curl_protocol_connect() to allow us to
+ * file_connect() gets called from Curl_protocol_connect() to allow us to
* do protocol-specific actions at connect-time. We emulate a
* connect-then-transfer protocol and "connect" to the file here
*/
-static CURLcode Curl_file_connect(struct connectdata *conn, bool *done)
+static CURLcode file_connect(struct connectdata *conn, bool *done)
{
struct SessionHandle *data = conn->data;
char *real_path = curl_easy_unescape(data, data->state.path, 0, NULL);
file->fd = fd;
if(!data->set.upload && (fd == -1)) {
failf(data, "Couldn't open file %s", data->state.path);
- Curl_file_done(conn, CURLE_FILE_COULDNT_READ_FILE, FALSE);
+ file_done(conn, CURLE_FILE_COULDNT_READ_FILE, FALSE);
return CURLE_FILE_COULDNT_READ_FILE;
}
*done = TRUE;
return CURLE_OK;
}
-static CURLcode Curl_file_done(struct connectdata *conn,
+static CURLcode file_done(struct connectdata *conn,
CURLcode status, bool premature)
{
struct FILEPROTO *file = conn->data->state.proto.file;
}
/*
- * Curl_file() is the protocol-specific function for the do-phase, separated
+ * file_do() is the protocol-specific function for the do-phase, separated
* from the connect-phase above. Other protocols merely setup the transfer in
* the do-phase, to have it done in the main transfer loop but since some
* platforms we support don't allow select()ing etc on file handles (as
* opposed to sockets) we instead perform the whole do-operation in this
* function.
*/
-static CURLcode Curl_file(struct connectdata *conn, bool *done)
+static CURLcode file_do(struct connectdata *conn, bool *done)
{
/* This implementation ignores the host name in conformance with
RFC 1738. Only local files (reachable via the standard file system)
bool ascii, ftpstate newstate);
static int ftp_need_type(struct connectdata *conn,
bool ascii);
-static CURLcode Curl_ftp(struct connectdata *conn, bool *done);
-static CURLcode Curl_ftp_done(struct connectdata *conn,
+static CURLcode ftp_do(struct connectdata *conn, bool *done);
+static CURLcode ftp_done(struct connectdata *conn,
CURLcode, bool premature);
-static CURLcode Curl_ftp_connect(struct connectdata *conn, bool *done);
-static CURLcode Curl_ftp_disconnect(struct connectdata *conn);
-static CURLcode Curl_ftp_nextconnect(struct connectdata *conn);
-static CURLcode Curl_ftp_multi_statemach(struct connectdata *conn, bool *done);
-static int Curl_ftp_getsock(struct connectdata *conn,
+static CURLcode ftp_connect(struct connectdata *conn, bool *done);
+static CURLcode ftp_disconnect(struct connectdata *conn);
+static CURLcode ftp_nextconnect(struct connectdata *conn);
+static CURLcode ftp_multi_statemach(struct connectdata *conn, bool *done);
+static int ftp_getsock(struct connectdata *conn,
curl_socket_t *socks,
int numsocks);
-static CURLcode Curl_ftp_doing(struct connectdata *conn,
+static CURLcode ftp_doing(struct connectdata *conn,
bool *dophase_done);
-static CURLcode Curl_ftp_setup_connection(struct connectdata * conn);
+static CURLcode ftp_setup_connection(struct connectdata * conn);
#ifdef USE_SSL
-static CURLcode Curl_ftps_setup_connection(struct connectdata * conn);
+static CURLcode ftps_setup_connection(struct connectdata * conn);
#endif
/* easy-to-use macro: */
const struct Curl_handler Curl_handler_ftp = {
"FTP", /* scheme */
- Curl_ftp_setup_connection, /* setup_connection */
- Curl_ftp, /* do_it */
- Curl_ftp_done, /* done */
- Curl_ftp_nextconnect, /* do_more */
- Curl_ftp_connect, /* connect_it */
- Curl_ftp_multi_statemach, /* connecting */
- Curl_ftp_doing, /* doing */
- Curl_ftp_getsock, /* proto_getsock */
- Curl_ftp_getsock, /* doing_getsock */
- Curl_ftp_disconnect, /* disconnect */
+ ftp_setup_connection, /* setup_connection */
+ ftp_do, /* do_it */
+ ftp_done, /* done */
+ ftp_nextconnect, /* do_more */
+ ftp_connect, /* connect_it */
+ ftp_multi_statemach, /* connecting */
+ ftp_doing, /* doing */
+ ftp_getsock, /* proto_getsock */
+ ftp_getsock, /* doing_getsock */
+ ftp_disconnect, /* disconnect */
PORT_FTP, /* defport */
PROT_FTP /* protocol */
};
const struct Curl_handler Curl_handler_ftps = {
"FTPS", /* scheme */
- Curl_ftps_setup_connection, /* setup_connection */
- Curl_ftp, /* do_it */
- Curl_ftp_done, /* done */
- Curl_ftp_nextconnect, /* do_more */
- Curl_ftp_connect, /* connect_it */
- Curl_ftp_multi_statemach, /* connecting */
- Curl_ftp_doing, /* doing */
- Curl_ftp_getsock, /* proto_getsock */
- Curl_ftp_getsock, /* doing_getsock */
- Curl_ftp_disconnect, /* disconnect */
+ ftps_setup_connection, /* setup_connection */
+ ftp_do, /* do_it */
+ ftp_done, /* done */
+ ftp_nextconnect, /* do_more */
+ ftp_connect, /* connect_it */
+ ftp_multi_statemach, /* connecting */
+ ftp_doing, /* doing */
+ ftp_getsock, /* proto_getsock */
+ ftp_getsock, /* doing_getsock */
+ ftp_disconnect, /* disconnect */
PORT_FTPS, /* defport */
PROT_FTP | PROT_FTPS | PROT_SSL /* protocol */
};
}
/* For the FTP "protocol connect" and "doing" phases only */
-static int Curl_ftp_getsock(struct connectdata *conn,
+static int ftp_getsock(struct connectdata *conn,
curl_socket_t *socks,
int numsocks)
{
result=Curl_setup_transfer(conn, -1, -1, FALSE, NULL, -1, NULL);
/* Set ->transfer so that we won't get any error in
- * Curl_ftp_done() because we didn't transfer anything! */
+ * ftp_done() because we didn't transfer anything! */
ftp->transfer = FTPTRANSFER_NONE;
state(conn, FTP_STOP);
result = Curl_setup_transfer(conn, -1, -1, FALSE, NULL, -1, NULL);
infof(data, "File already completely downloaded\n");
- /* Set ->transfer so that we won't get any error in Curl_ftp_done()
+ /* Set ->transfer so that we won't get any error in ftp_done()
* because we didn't transfer the any file */
ftp->transfer = FTPTRANSFER_NONE;
state(conn, FTP_STOP);
/* called repeatedly until done from multi.c */
-static CURLcode Curl_ftp_multi_statemach(struct connectdata *conn,
+static CURLcode ftp_multi_statemach(struct connectdata *conn,
bool *done)
{
curl_socket_t sock = conn->sock[FIRSTSOCKET];
}
/*
- * Curl_ftp_connect() should do everything that is to be considered a part of
+ * ftp_connect() should do everything that is to be considered a part of
* the connection phase.
*
* The variable 'done' points to will be TRUE if the protocol-layer connect
* phase is done when this function returns, or FALSE is not. When called as
* a part of the easy interface, it will always be TRUE.
*/
-static CURLcode Curl_ftp_connect(struct connectdata *conn,
+static CURLcode ftp_connect(struct connectdata *conn,
bool *done) /* see description above */
{
CURLcode result;
ftpc->response = Curl_tvnow(); /* start response time-out now! */
if(data->state.used_interface == Curl_if_multi)
- result = Curl_ftp_multi_statemach(conn, done);
+ result = ftp_multi_statemach(conn, done);
else {
result = ftp_easy_statemach(conn);
if(!result)
/***********************************************************************
*
- * Curl_ftp_done()
+ * ftp_done()
*
* The DONE function. This does what needs to be done after a single DO has
* performed.
*
* Input argument is already checked for validity.
*/
-static CURLcode Curl_ftp_done(struct connectdata *conn, CURLcode status,
+static CURLcode ftp_done(struct connectdata *conn, CURLcode status,
bool premature)
{
struct SessionHandle *data = conn->data;
/*
- * Curl_ftp_nextconnect()
+ * ftp_nextconnect()
*
* This function shall be called when the second FTP (data) connection is
* connected.
*/
-static CURLcode Curl_ftp_nextconnect(struct connectdata *conn)
+static CURLcode ftp_nextconnect(struct connectdata *conn)
{
struct SessionHandle *data=conn->data;
struct ftp_conn *ftpc = &conn->proto.ftpc;
CURLcode result = CURLE_OK;
- /* the ftp struct is inited in Curl_ftp_connect() */
+ /* the ftp struct is inited in ftp_connect() */
struct FTP *ftp = data->state.proto.ftp;
DEBUGF(infof(data, "DO-MORE phase starts\n"));
/* run the state-machine */
if(conn->data->state.used_interface == Curl_if_multi)
- result = Curl_ftp_multi_statemach(conn, dophase_done);
+ result = ftp_multi_statemach(conn, dophase_done);
else {
result = ftp_easy_statemach(conn);
*dophase_done = TRUE; /* with the easy interface we are done here */
/***********************************************************************
*
- * Curl_ftp()
+ * ftp_do()
*
* This function is registered as 'curl_do' function. It decodes the path
* parts etc as a wrapper to the actual DO function (ftp_perform).
*
* The input argument is already checked for validity.
*/
-static CURLcode Curl_ftp(struct connectdata *conn, bool *done)
+static CURLcode ftp_do(struct connectdata *conn, bool *done)
{
CURLcode retcode = CURLE_OK;
Since connections can be re-used between SessionHandles, this might be a
connection already existing but on a fresh SessionHandle struct so we must
make sure we have a good 'struct FTP' to play with. For new connections,
- the struct FTP is allocated and setup in the Curl_ftp_connect() function.
+ the struct FTP is allocated and setup in the ftp_connect() function.
*/
Curl_reset_reqproto(conn);
retcode = ftp_init(conn);
/***********************************************************************
*
- * Curl_ftp_disconnect()
+ * ftp_disconnect()
*
* Disconnect from an FTP server. Cleanup protocol-specific per-connection
* resources. BLOCKING.
*/
-static CURLcode Curl_ftp_disconnect(struct connectdata *conn)
+static CURLcode ftp_disconnect(struct connectdata *conn)
{
struct ftp_conn *ftpc= &conn->proto.ftpc;
struct ftp_conn *ftpc = &conn->proto.ftpc;
if(connected)
- result = Curl_ftp_nextconnect(conn);
+ result = ftp_nextconnect(conn);
if(result && (conn->sock[SECONDARYSOCKET] != CURL_SOCKET_BAD)) {
/* Failure detected, close the second socket if it was created already */
}
/* called from multi.c while DOing */
-static CURLcode Curl_ftp_doing(struct connectdata *conn,
+static CURLcode ftp_doing(struct connectdata *conn,
bool *dophase_done)
{
CURLcode result;
- result = Curl_ftp_multi_statemach(conn, dophase_done);
+ result = ftp_multi_statemach(conn, dophase_done);
if(*dophase_done) {
result = ftp_dophase_done(conn, FALSE /* not connected */);
* remote host.
*
* ftp->ctl_valid starts out as FALSE, and gets set to TRUE if we reach the
- * Curl_ftp_done() function without finding any major problem.
+ * ftp_done() function without finding any major problem.
*/
static
CURLcode ftp_regular_transfer(struct connectdata *conn,
return result;
}
-static CURLcode Curl_ftp_setup_connection(struct connectdata * conn)
+static CURLcode ftp_setup_connection(struct connectdata * conn)
{
struct SessionHandle *data = conn->data;
char * type;
}
#ifdef USE_SSL
-static CURLcode Curl_ftps_setup_connection(struct connectdata * conn)
+static CURLcode ftps_setup_connection(struct connectdata * conn)
{
struct SessionHandle *data = conn->data;
conn->ssl[SECONDARYSOCKET].use = data->set.ftp_ssl != CURLUSESSL_CONTROL;
- return Curl_ftp_setup_connection(conn);
+ return ftp_setup_connection(conn);
}
#endif
* Forward declarations.
*/
-static CURLcode Curl_https_connecting(struct connectdata *conn, bool *done);
+static CURLcode https_connecting(struct connectdata *conn, bool *done);
#ifdef USE_SSL
-static int Curl_https_getsock(struct connectdata *conn,
+static int https_getsock(struct connectdata *conn,
curl_socket_t *socks,
int numsocks);
#endif
Curl_http_done, /* done */
ZERO_NULL, /* do_more */
Curl_http_connect, /* connect_it */
- Curl_https_connecting, /* connecting */
+ https_connecting, /* connecting */
ZERO_NULL, /* doing */
- Curl_https_getsock, /* proto_getsock */
+ https_getsock, /* proto_getsock */
ZERO_NULL, /* doing_getsock */
ZERO_NULL, /* disconnect */
PORT_HTTPS, /* defport */
}
/*
- * Curl_output_basic() sets up an Authorization: header (or the proxy version)
+ * http_output_basic() sets up an Authorization: header (or the proxy version)
* for HTTP Basic authentication.
*
* Returns CURLcode.
*/
-static CURLcode Curl_output_basic(struct connectdata *conn, bool proxy)
+static CURLcode http_output_basic(struct connectdata *conn, bool proxy)
{
char *authorization;
struct SessionHandle *data=conn->data;
* @returns CURLcode
*/
static CURLcode
-Curl_http_output_auth(struct connectdata *conn,
- const char *request,
- const char *path,
- bool proxytunnel) /* TRUE if this is the request setting
- up the proxy tunnel */
+http_output_auth(struct connectdata *conn,
+ const char *request,
+ const char *path,
+ bool proxytunnel) /* TRUE if this is the request setting
+ up the proxy tunnel */
{
CURLcode result = CURLE_OK;
struct SessionHandle *data = conn->data;
if(conn->bits.proxy_user_passwd &&
!checkheaders(data, "Proxy-authorization:")) {
auth="Basic";
- result = Curl_output_basic(conn, TRUE);
+ result = http_output_basic(conn, TRUE);
if(result)
return result;
}
- /* NOTE: Curl_output_basic() should set 'done' TRUE, as the other auth
+ /* NOTE: http_output_basic() should set 'done' TRUE, as the other auth
functions work that way */
authproxy->done = TRUE;
}
if(conn->bits.user_passwd &&
!checkheaders(data, "Authorization:")) {
auth="Basic";
- result = Curl_output_basic(conn, FALSE);
+ result = http_output_basic(conn, FALSE);
if(result)
return result;
}
}
/* Setup the proxy-authorization header, if any */
- result = Curl_http_output_auth(conn, (char *)"CONNECT", host_port, TRUE);
+ result = http_output_auth(conn, (char *)"CONNECT", host_port, TRUE);
if(CURLE_OK == result) {
char *host=(char *)"";
if(conn->protocol & PROT_HTTPS) {
/* perform SSL initialization */
if(data->state.used_interface == Curl_if_multi) {
- result = Curl_https_connecting(conn, done);
+ result = https_connecting(conn, done);
if(result)
return result;
}
return CURLE_OK;
}
-static CURLcode Curl_https_connecting(struct connectdata *conn, bool *done)
+static CURLcode https_connecting(struct connectdata *conn, bool *done)
{
CURLcode result;
DEBUGASSERT((conn) && (conn->protocol & PROT_HTTPS));
#ifdef USE_SSLEAY
/* This function is OpenSSL-specific. It should be made to query the generic
SSL layer instead. */
-static int Curl_https_getsock(struct connectdata *conn,
+static int https_getsock(struct connectdata *conn,
curl_socket_t *socks,
int numsocks)
{
}
#else
#ifdef USE_GNUTLS
-int Curl_https_getsock(struct connectdata *conn,
+int https_getsock(struct connectdata *conn,
curl_socket_t *socks,
int numsocks)
{
}
#else
#ifdef USE_NSS
-int Curl_https_getsock(struct connectdata *conn,
+int https_getsock(struct connectdata *conn,
curl_socket_t *socks,
int numsocks)
{
}
#else
#ifdef USE_QSOSSL
-int Curl_https_getsock(struct connectdata *conn,
+int https_getsock(struct connectdata *conn,
curl_socket_t *socks,
int numsocks)
{
}
/* setup the authentication headers */
- result = Curl_http_output_auth(conn, request, ppath, FALSE);
+ result = http_output_auth(conn, request, ppath, FALSE);
if(result)
return result;
#include <curl/curl.h>
-static time_t Curl_parsedate(const char *date);
+static time_t parsedate(const char *date);
const char * const Curl_wkday[] =
{"Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"};
DATE_TIME
};
-static time_t Curl_parsedate(const char *date)
+static time_t parsedate(const char *date)
{
time_t t = 0;
int wdaynum=-1; /* day of the week number, 0-6 (mon-sun) */
time_t curl_getdate(const char *p, const time_t *now)
{
(void)now;
- return Curl_parsedate(p);
+ return parsedate(p);
}
return res;
}
-static ssize_t Curl_plain_send(struct connectdata *conn,
- int num,
- void *mem,
- size_t len)
+static ssize_t send_plain(struct connectdata *conn,
+ int num,
+ void *mem,
+ size_t len)
{
curl_socket_t sockfd = conn->sock[num];
ssize_t bytes_written = swrite(sockfd, mem, len);
/* only TRUE if krb enabled */
bytes_written = Curl_sec_send(conn, num, mem, len);
else
- bytes_written = Curl_plain_send(conn, num, mem, len);
+ bytes_written = send_plain(conn, num, mem, len);
*written = bytes_written;
retcode = (-1 != bytes_written)?CURLE_OK:CURLE_SEND_ERROR;
return 0;
}
-static int Curl_ASN1_UTCTIME_output(struct connectdata *conn,
- const char *prefix,
- const ASN1_UTCTIME *tm)
+static int asn1_output(struct connectdata *conn,
+ const char *prefix,
+ const ASN1_UTCTIME *tm)
{
const char *asn1_string;
int gmt=FALSE;
/* ====================================================== */
static CURLcode
-Curl_ossl_connect_step1(struct connectdata *conn,
- int sockindex)
+ossl_connect_step1(struct connectdata *conn,
+ int sockindex)
{
CURLcode retcode = CURLE_OK;
}
static CURLcode
-Curl_ossl_connect_step2(struct connectdata *conn,
- int sockindex, long *timeout_ms)
+ossl_connect_step2(struct connectdata *conn,
+ int sockindex, long *timeout_ms)
{
struct SessionHandle *data = conn->data;
int err;
CRYPTO_free(str);
certdate = X509_get_notBefore(connssl->server_cert);
- Curl_ASN1_UTCTIME_output(conn, "\t start date: ", certdate);
+ asn1_output(conn, "\t start date: ", certdate);
certdate = X509_get_notAfter(connssl->server_cert);
- Curl_ASN1_UTCTIME_output(conn, "\t expire date: ", certdate);
+ asn1_output(conn, "\t expire date: ", certdate);
if(data->set.ssl.verifyhost) {
retcode = verifyhost(conn, connssl->server_cert);
static CURLcode
-Curl_ossl_connect_step3(struct connectdata *conn,
- int sockindex)
+ossl_connect_step3(struct connectdata *conn,
+ int sockindex)
{
CURLcode retcode = CURLE_OK;
void *ssl_sessionid=NULL;
}
static CURLcode
-Curl_ossl_connect_common(struct connectdata *conn,
- int sockindex,
- bool nonblocking,
- bool *done)
+ossl_connect_common(struct connectdata *conn,
+ int sockindex,
+ bool nonblocking,
+ bool *done)
{
CURLcode retcode;
struct SessionHandle *data = conn->data;
long timeout_ms;
if(ssl_connect_1==connssl->connecting_state) {
- retcode = Curl_ossl_connect_step1(conn, sockindex);
+ retcode = ossl_connect_step1(conn, sockindex);
if(retcode)
return retcode;
}
}
/* get the timeout from step2 to avoid computing it twice. */
- retcode = Curl_ossl_connect_step2(conn, sockindex, &timeout_ms);
+ retcode = ossl_connect_step2(conn, sockindex, &timeout_ms);
if(retcode)
return retcode;
if(ssl_connect_3==connssl->connecting_state) {
- retcode = Curl_ossl_connect_step3(conn, sockindex);
+ retcode = ossl_connect_step3(conn, sockindex);
if(retcode)
return retcode;
}
int sockindex,
bool *done)
{
- return Curl_ossl_connect_common(conn, sockindex, TRUE, done);
+ return ossl_connect_common(conn, sockindex, TRUE, done);
}
CURLcode
CURLcode retcode;
bool done = FALSE;
- retcode = Curl_ossl_connect_common(conn, sockindex, FALSE, &done);
+ retcode = ossl_connect_common(conn, sockindex, FALSE, &done);
if(retcode)
return retcode;
size_t length);
static void suboption(struct connectdata *);
-static CURLcode Curl_telnet(struct connectdata *conn, bool *done);
-static CURLcode Curl_telnet_done(struct connectdata *conn,
+static CURLcode telnet_do(struct connectdata *conn, bool *done);
+static CURLcode telnet_done(struct connectdata *conn,
CURLcode, bool premature);
/* For negotiation compliant to RFC 1143 */
const struct Curl_handler Curl_handler_telnet = {
"TELNET", /* scheme */
ZERO_NULL, /* setup_connection */
- Curl_telnet, /* do_it */
- Curl_telnet_done, /* done */
+ telnet_do, /* do_it */
+ telnet_done, /* done */
ZERO_NULL, /* do_more */
ZERO_NULL, /* connect_it */
ZERO_NULL, /* connecting */
bufferflush();
}
-static CURLcode Curl_telnet_done(struct connectdata *conn,
+static CURLcode telnet_done(struct connectdata *conn,
CURLcode status, bool premature)
{
struct TELNET *tn = (struct TELNET *)conn->data->state.proto.telnet;
return CURLE_OK;
}
-static CURLcode Curl_telnet(struct connectdata *conn, bool *done)
+static CURLcode telnet_do(struct connectdata *conn, bool *done)
{
CURLcode code;
struct SessionHandle *data = conn->data;
/* Forward declarations */
static CURLcode tftp_rx(tftp_state_data_t *state, tftp_event_t event) ;
static CURLcode tftp_tx(tftp_state_data_t *state, tftp_event_t event) ;
-static CURLcode Curl_tftp_connect(struct connectdata *conn, bool *done);
-static CURLcode Curl_tftp(struct connectdata *conn, bool *done);
-static CURLcode Curl_tftp_done(struct connectdata *conn,
+static CURLcode tftp_connect(struct connectdata *conn, bool *done);
+static CURLcode tftp_do(struct connectdata *conn, bool *done);
+static CURLcode tftp_done(struct connectdata *conn,
CURLcode, bool premature);
-static CURLcode Curl_tftp_setup_connection(struct connectdata * conn);
+static CURLcode tftp_setup_connection(struct connectdata * conn);
/*
const struct Curl_handler Curl_handler_tftp = {
"TFTP", /* scheme */
- Curl_tftp_setup_connection, /* setup_connection */
- Curl_tftp, /* do_it */
- Curl_tftp_done, /* done */
+ tftp_setup_connection, /* setup_connection */
+ tftp_do, /* do_it */
+ tftp_done, /* done */
ZERO_NULL, /* do_more */
- Curl_tftp_connect, /* connect_it */
+ tftp_connect, /* connect_it */
ZERO_NULL, /* connecting */
ZERO_NULL, /* doing */
ZERO_NULL, /* proto_getsock */
/**********************************************************
*
- * Curl_tftp_connect
+ * tftp_connect
*
* The connect callback
*
**********************************************************/
-static CURLcode Curl_tftp_connect(struct connectdata *conn, bool *done)
+static CURLcode tftp_connect(struct connectdata *conn, bool *done)
{
CURLcode code;
tftp_state_data_t *state;
/**********************************************************
*
- * Curl_tftp_done
+ * tftp_done
*
* The done callback
*
**********************************************************/
-static CURLcode Curl_tftp_done(struct connectdata *conn, CURLcode status,
+static CURLcode tftp_done(struct connectdata *conn, CURLcode status,
bool premature)
{
(void)status; /* unused */
/**********************************************************
*
- * Curl_tftp
+ * tftp
*
* The do callback
*
*
**********************************************************/
-static CURLcode Curl_tftp(struct connectdata *conn, bool *done)
+static CURLcode tftp_do(struct connectdata *conn, bool *done)
{
struct SessionHandle *data = conn->data;
tftp_state_data_t *state;
Since connections can be re-used between SessionHandles, this might be a
connection already existing but on a fresh SessionHandle struct so we must
make sure we have a good 'struct TFTP' to play with. For new connections,
- the struct TFTP is allocated and setup in the Curl_tftp_connect() function.
+ the struct TFTP is allocated and setup in the tftp_connect() function.
*/
Curl_reset_reqproto(conn);
if(!data->state.proto.tftp) {
- code = Curl_tftp_connect(conn, done);
+ code = tftp_connect(conn, done);
if(code)
return code;
}
return code;
}
-static CURLcode Curl_tftp_setup_connection(struct connectdata * conn)
+static CURLcode tftp_setup_connection(struct connectdata * conn)
{
struct SessionHandle *data = conn->data;
char * type;
}
static CURLcode
-Curl_connect_host(struct SessionHandle *data,
- struct connectdata **conn)
+connect_host(struct SessionHandle *data,
+ struct connectdata **conn)
{
CURLcode res = CURLE_OK;
int urlchanged = FALSE;
*/
do {
- res = Curl_connect_host(data, &conn); /* primary connection */
+ res = connect_host(data, &conn); /* primary connection */
if(res == CURLE_OK) {
bool do_done;
Curl_safefree(data->set.str[i]);
}
-static CURLcode Curl_setstropt(char **charp, char * s)
+static CURLcode setstropt(char **charp, char * s)
{
/* Release the previous storage at `charp' and replace by a dynamic storage
copy of `s'. Return CURLE_OK or CURLE_OUT_OF_MEMORY. */
/* duplicate all strings */
for(i=(enum dupstring)0; i< STRING_LAST; i++) {
- r = Curl_setstropt(&dst->set.str[i], src->set.str[i]);
+ r = setstropt(&dst->set.str[i], src->set.str[i]);
if(r != CURLE_OK)
break;
}
data->set.ssl.sessionid = TRUE; /* session ID caching enabled by default */
#ifdef CURL_CA_BUNDLE
/* This is our preferred CA cert bundle since install time */
- res = Curl_setstropt(&data->set.str[STRING_SSL_CAFILE],
+ res = setstropt(&data->set.str[STRING_SSL_CAFILE],
(char *) CURL_CA_BUNDLE);
#endif
}
break;
case CURLOPT_SSL_CIPHER_LIST:
/* set a list of cipher we want to use in the SSL connection */
- result = Curl_setstropt(&data->set.str[STRING_SSL_CIPHER_LIST],
+ result = setstropt(&data->set.str[STRING_SSL_CIPHER_LIST],
va_arg(param, char *));
break;
* This is the path name to a file that contains random data to seed
* the random SSL stuff with. The file is only used for reading.
*/
- result = Curl_setstropt(&data->set.str[STRING_SSL_RANDOM_FILE],
+ result = setstropt(&data->set.str[STRING_SSL_RANDOM_FILE],
va_arg(param, char *));
break;
case CURLOPT_EGDSOCKET:
/*
* The Entropy Gathering Daemon socket pathname
*/
- result = Curl_setstropt(&data->set.str[STRING_SSL_EGDSOCKET],
+ result = setstropt(&data->set.str[STRING_SSL_EGDSOCKET],
va_arg(param, char *));
break;
case CURLOPT_MAXCONNECTS:
/*
* Use this file instead of the $HOME/.netrc file
*/
- result = Curl_setstropt(&data->set.str[STRING_NETRC_FILE],
+ result = setstropt(&data->set.str[STRING_NETRC_FILE],
va_arg(param, char *));
break;
case CURLOPT_TRANSFERTEXT:
*
*/
argptr = va_arg(param, char *);
- result = Curl_setstropt(&data->set.str[STRING_ENCODING],
+ result = setstropt(&data->set.str[STRING_ENCODING],
(argptr && !*argptr)?
(char *) ALL_CONTENT_ENCODINGS: argptr);
break;
argptr = va_arg(param, char *);
if(!argptr || data->set.postfieldsize == -1)
- result = Curl_setstropt(&data->set.str[STRING_COPYPOSTFIELDS], argptr);
+ result = setstropt(&data->set.str[STRING_COPYPOSTFIELDS], argptr);
else {
/*
* Check that requested length does not overflow the size_t type.
else {
char * p;
- (void) Curl_setstropt(&data->set.str[STRING_COPYPOSTFIELDS], NULL);
+ (void) setstropt(&data->set.str[STRING_COPYPOSTFIELDS], NULL);
/* Allocate even when size == 0. This satisfies the need of possible
later address compare to detect the COPYPOSTFIELDS mode, and
*/
data->set.postfields = va_arg(param, void *);
/* Release old copied data. */
- (void) Curl_setstropt(&data->set.str[STRING_COPYPOSTFIELDS], NULL);
+ (void) setstropt(&data->set.str[STRING_COPYPOSTFIELDS], NULL);
data->set.httpreq = HTTPREQ_POST;
break;
if(data->set.postfieldsize < bigsize &&
data->set.postfields == data->set.str[STRING_COPYPOSTFIELDS]) {
/* Previous CURLOPT_COPYPOSTFIELDS is no longer valid. */
- (void) Curl_setstropt(&data->set.str[STRING_COPYPOSTFIELDS], NULL);
+ (void) setstropt(&data->set.str[STRING_COPYPOSTFIELDS], NULL);
data->set.postfields = NULL;
}
if(data->set.postfieldsize < bigsize &&
data->set.postfields == data->set.str[STRING_COPYPOSTFIELDS]) {
/* Previous CURLOPT_COPYPOSTFIELDS is no longer valid. */
- (void) Curl_setstropt(&data->set.str[STRING_COPYPOSTFIELDS], NULL);
+ (void) setstropt(&data->set.str[STRING_COPYPOSTFIELDS], NULL);
data->set.postfields = NULL;
}
free(data->change.referer);
data->change.referer_alloc = FALSE;
}
- result = Curl_setstropt(&data->set.str[STRING_SET_REFERER],
+ result = setstropt(&data->set.str[STRING_SET_REFERER],
va_arg(param, char *));
data->change.referer = data->set.str[STRING_SET_REFERER];
break;
/*
* String to use in the HTTP User-Agent field
*/
- result = Curl_setstropt(&data->set.str[STRING_USERAGENT],
+ result = setstropt(&data->set.str[STRING_USERAGENT],
va_arg(param, char *));
break;
/*
* Cookie string to send to the remote server in the request.
*/
- result = Curl_setstropt(&data->set.str[STRING_COOKIE],
+ result = setstropt(&data->set.str[STRING_COOKIE],
va_arg(param, char *));
break;
/*
* Set cookie file name to dump all cookies to when we're done.
*/
- result = Curl_setstropt(&data->set.str[STRING_COOKIEJAR],
+ result = setstropt(&data->set.str[STRING_COOKIEJAR],
va_arg(param, char *));
/*
/*
* Set a custom string to use as request
*/
- result = Curl_setstropt(&data->set.str[STRING_CUSTOMREQUEST],
+ result = setstropt(&data->set.str[STRING_CUSTOMREQUEST],
va_arg(param, char *));
/* we don't set
* Setting it to NULL, means no proxy but allows the environment variables
* to decide for us.
*/
- result = Curl_setstropt(&data->set.str[STRING_PROXY],
+ result = setstropt(&data->set.str[STRING_PROXY],
va_arg(param, char *));
break;
/*
* Use FTP PORT, this also specifies which IP address to use
*/
- result = Curl_setstropt(&data->set.str[STRING_FTPPORT],
+ result = setstropt(&data->set.str[STRING_FTPPORT],
va_arg(param, char *));
data->set.ftp_use_port = (bool)(NULL != data->set.str[STRING_FTPPORT]);
break;
free(data->change.url);
data->change.url_alloc=FALSE;
}
- result = Curl_setstropt(&data->set.str[STRING_SET_URL],
+ result = setstropt(&data->set.str[STRING_SET_URL],
va_arg(param, char *));
data->change.url = data->set.str[STRING_SET_URL];
if(data->change.url)
/*
* user:password to use in the operation
*/
- result = Curl_setstropt(&data->set.str[STRING_USERPWD],
+ result = setstropt(&data->set.str[STRING_USERPWD],
va_arg(param, char *));
break;
case CURLOPT_POSTQUOTE:
/*
* user:password needed to use the proxy
*/
- result = Curl_setstropt(&data->set.str[STRING_PROXYUSERPWD],
+ result = setstropt(&data->set.str[STRING_PROXYUSERPWD],
va_arg(param, char *));
break;
case CURLOPT_RANGE:
/*
* What range of the file you want to transfer
*/
- result = Curl_setstropt(&data->set.str[STRING_SET_RANGE],
+ result = setstropt(&data->set.str[STRING_SET_RANGE],
va_arg(param, char *));
break;
case CURLOPT_RESUME_FROM:
/*
* String that holds file name of the SSL certificate to use
*/
- result = Curl_setstropt(&data->set.str[STRING_CERT],
+ result = setstropt(&data->set.str[STRING_CERT],
va_arg(param, char *));
break;
case CURLOPT_SSLCERTTYPE:
/*
* String that holds file type of the SSL certificate to use
*/
- result = Curl_setstropt(&data->set.str[STRING_CERT_TYPE],
+ result = setstropt(&data->set.str[STRING_CERT_TYPE],
va_arg(param, char *));
break;
case CURLOPT_SSLKEY:
/*
* String that holds file name of the SSL certificate to use
*/
- result = Curl_setstropt(&data->set.str[STRING_KEY],
+ result = setstropt(&data->set.str[STRING_KEY],
va_arg(param, char *));
break;
case CURLOPT_SSLKEYTYPE:
/*
* String that holds file type of the SSL certificate to use
*/
- result = Curl_setstropt(&data->set.str[STRING_KEY_TYPE],
+ result = setstropt(&data->set.str[STRING_KEY_TYPE],
va_arg(param, char *));
break;
case CURLOPT_KEYPASSWD:
/*
* String that holds the SSL or SSH private key password.
*/
- result = Curl_setstropt(&data->set.str[STRING_KEY_PASSWD],
+ result = setstropt(&data->set.str[STRING_KEY_PASSWD],
va_arg(param, char *));
break;
case CURLOPT_SSLENGINE:
* Set what interface or address/hostname to bind the socket to when
* performing an operation and thus what from-IP your connection will use.
*/
- result = Curl_setstropt(&data->set.str[STRING_DEVICE],
+ result = setstropt(&data->set.str[STRING_DEVICE],
va_arg(param, char *));
break;
case CURLOPT_LOCALPORT:
/*
* A string that defines the kerberos security level.
*/
- result = Curl_setstropt(&data->set.str[STRING_KRB_LEVEL],
+ result = setstropt(&data->set.str[STRING_KRB_LEVEL],
va_arg(param, char *));
data->set.krb = (bool)(NULL != data->set.str[STRING_KRB_LEVEL]);
break;
/*
* Set CA info for SSL connection. Specify file name of the CA certificate
*/
- result = Curl_setstropt(&data->set.str[STRING_SSL_CAFILE],
+ result = setstropt(&data->set.str[STRING_SSL_CAFILE],
va_arg(param, char *));
break;
case CURLOPT_CAPATH:
* certificates which have been prepared using openssl c_rehash utility.
*/
/* This does not work on windows. */
- result = Curl_setstropt(&data->set.str[STRING_SSL_CAPATH],
+ result = setstropt(&data->set.str[STRING_SSL_CAPATH],
va_arg(param, char *));
break;
case CURLOPT_TELNETOPTIONS:
These former 3rd party transfer options are deprecated */
case CURLOPT_FTP_ACCOUNT:
- result = Curl_setstropt(&data->set.str[STRING_FTP_ACCOUNT],
+ result = setstropt(&data->set.str[STRING_FTP_ACCOUNT],
va_arg(param, char *));
break;
break;
case CURLOPT_FTP_ALTERNATIVE_TO_USER:
- result = Curl_setstropt(&data->set.str[STRING_FTP_ALTERNATIVE_TO_USER],
+ result = setstropt(&data->set.str[STRING_FTP_ALTERNATIVE_TO_USER],
va_arg(param, char *));
break;
/*
* Use this file instead of the $HOME/.ssh/id_dsa.pub file
*/
- result = Curl_setstropt(&data->set.str[STRING_SSH_PUBLIC_KEY],
+ result = setstropt(&data->set.str[STRING_SSH_PUBLIC_KEY],
va_arg(param, char *));
break;
/*
* Use this file instead of the $HOME/.ssh/id_dsa file
*/
- result = Curl_setstropt(&data->set.str[STRING_SSH_PRIVATE_KEY],
+ result = setstropt(&data->set.str[STRING_SSH_PRIVATE_KEY],
va_arg(param, char *));
break;
case CURLOPT_SSH_HOST_PUBLIC_KEY_MD5:
* Option to allow for the MD5 of the host public key to be checked
* for validation purposes.
*/
- result = Curl_setstropt(&data->set.str[STRING_SSH_HOST_PUBLIC_KEY_MD5],
+ result = setstropt(&data->set.str[STRING_SSH_HOST_PUBLIC_KEY_MD5],
va_arg(param, char *));
break;
case CURLOPT_HTTP_TRANSFER_DECODING: