From 2da127abb54c6b5fa514f3a92ca5bce5e82d8120 Mon Sep 17 00:00:00 2001 From: Steve Holme Date: Fri, 12 Apr 2013 20:16:57 +0100 Subject: pop3: Moved utility functions to end of pop3.c --- lib/pop3.c | 66 +++++++++++++++++++++++++++++++------------------------------- 1 file changed, 33 insertions(+), 33 deletions(-) (limited to 'lib/pop3.c') diff --git a/lib/pop3.c b/lib/pop3.c index 10975edb9..dadb443d2 100644 --- a/lib/pop3.c +++ b/lib/pop3.c @@ -90,8 +90,6 @@ #include "memdebug.h" /* Local API functions */ -static CURLcode pop3_parse_url_path(struct connectdata *conn); -static CURLcode pop3_parse_custom_request(struct connectdata *conn); static CURLcode pop3_regular_transfer(struct connectdata *conn, bool *done); static CURLcode pop3_do(struct connectdata *conn, bool *done); static CURLcode pop3_done(struct connectdata *conn, CURLcode status, @@ -103,6 +101,8 @@ static int pop3_getsock(struct connectdata *conn, curl_socket_t *socks, int numsocks); static CURLcode pop3_doing(struct connectdata *conn, bool *dophase_done); static CURLcode pop3_setup_connection(struct connectdata *conn); +static CURLcode pop3_parse_url_path(struct connectdata *conn); +static CURLcode pop3_parse_custom_request(struct connectdata *conn); /* * POP3 protocol handler. @@ -1514,37 +1514,6 @@ static CURLcode pop3_disconnect(struct connectdata *conn, return CURLE_OK; } -/*********************************************************************** - * - * pop3_parse_url_path() - * - * Parse the URL path into separate path components. - */ -static CURLcode pop3_parse_url_path(struct connectdata *conn) -{ - /* The POP3 struct is already initialised in pop3_connect() */ - struct SessionHandle *data = conn->data; - struct POP3 *pop3 = data->state.proto.pop3; - const char *path = data->state.path; - - /* URL decode the path for the message ID */ - return Curl_urldecode(data, path, 0, &pop3->id, NULL, TRUE); -} - -static CURLcode pop3_parse_custom_request(struct connectdata *conn) -{ - CURLcode result = CURLE_OK; - struct SessionHandle *data = conn->data; - struct POP3 *pop3 = data->state.proto.pop3; - const char *custom = data->set.str[STRING_CUSTOMREQUEST]; - - /* URL decode the custom request */ - if(custom) - result = Curl_urldecode(data, custom, 0, &pop3->custom, NULL, TRUE); - - return result; -} - /* Call this when the DO phase has completed */ static CURLcode pop3_dophase_done(struct connectdata *conn, bool connected) { @@ -1639,6 +1608,37 @@ static CURLcode pop3_setup_connection(struct connectdata *conn) return CURLE_OK; } +/*********************************************************************** + * + * pop3_parse_url_path() + * + * Parse the URL path into separate path components. + */ +static CURLcode pop3_parse_url_path(struct connectdata *conn) +{ + /* The POP3 struct is already initialised in pop3_connect() */ + struct SessionHandle *data = conn->data; + struct POP3 *pop3 = data->state.proto.pop3; + const char *path = data->state.path; + + /* URL decode the path for the message ID */ + return Curl_urldecode(data, path, 0, &pop3->id, NULL, TRUE); +} + +static CURLcode pop3_parse_custom_request(struct connectdata *conn) +{ + CURLcode result = CURLE_OK; + struct SessionHandle *data = conn->data; + struct POP3 *pop3 = data->state.proto.pop3; + const char *custom = data->set.str[STRING_CUSTOMREQUEST]; + + /* URL decode the custom request */ + if(custom) + result = Curl_urldecode(data, custom, 0, &pop3->custom, NULL, TRUE); + + return result; +} + /* This function scans the body after the end-of-body and writes everything until the end is found */ CURLcode Curl_pop3_write(struct connectdata *conn, char *str, size_t nread) -- cgit v1.2.3