diff options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/pop3.c | 70 | 
1 files changed, 35 insertions, 35 deletions
diff --git a/lib/pop3.c b/lib/pop3.c index ee4a713a8..31ce5ab72 100644 --- a/lib/pop3.c +++ b/lib/pop3.c @@ -578,6 +578,41 @@ static CURLcode pop3_authenticate(struct connectdata *conn)    return result;  } +/* Start the DO phase for the command */ +static CURLcode pop3_command(struct connectdata *conn) +{ +  CURLcode result = CURLE_OK; +  struct SessionHandle *data = conn->data; +  struct POP3 *pop3 = data->state.proto.pop3; +  const char *command = NULL; + +  /* Calculate the default command */ +  if(pop3->id[0] == '\0' || conn->data->set.ftp_list_only) { +    command = "LIST"; + +    if(pop3->id[0] != '\0') +      /* Message specific LIST so skip the BODY transfer */ +      pop3->transfer = FTPTRANSFER_INFO; +  } +  else +    command = "RETR"; + +  /* Send the command */ +  if(pop3->id[0] != '\0') +    result = Curl_pp_sendf(&conn->proto.pop3c.pp, "%s %s", +                           (pop3->custom && pop3->custom[0] != '\0' ? +                            pop3->custom : command), pop3->id); +  else +    result = Curl_pp_sendf(&conn->proto.pop3c.pp, +                           (pop3->custom && pop3->custom[0] != '\0' ? +                            pop3->custom : command)); + +  if(!result) +    state(conn, POP3_COMMAND); + +  return result; +} +  /* For the initial server greeting */  static CURLcode pop3_state_servergreet_resp(struct connectdata *conn,                                              int pop3code, @@ -1051,41 +1086,6 @@ static CURLcode pop3_state_pass_resp(struct connectdata *conn, int pop3code,    return result;  } -/* Start the DO phase for the command */ -static CURLcode pop3_command(struct connectdata *conn) -{ -  CURLcode result = CURLE_OK; -  struct SessionHandle *data = conn->data; -  struct POP3 *pop3 = data->state.proto.pop3; -  const char *command = NULL; - -  /* Calculate the default command */ -  if(pop3->id[0] == '\0' || conn->data->set.ftp_list_only) { -    command = "LIST"; - -    if(pop3->id[0] != '\0') -      /* Message specific LIST so skip the BODY transfer */ -      pop3->transfer = FTPTRANSFER_INFO; -  } -  else -    command = "RETR"; - -  /* Send the command */ -  if(pop3->id[0] != '\0') -    result = Curl_pp_sendf(&conn->proto.pop3c.pp, "%s %s", -                           (pop3->custom && pop3->custom[0] != '\0' ? -                            pop3->custom : command), pop3->id); -  else -    result = Curl_pp_sendf(&conn->proto.pop3c.pp, -                           (pop3->custom && pop3->custom[0] != '\0' ? -                            pop3->custom : command)); - -  if(!result) -    state(conn, POP3_COMMAND); - -  return result; -} -  /* For command responses */  static CURLcode pop3_state_command_resp(struct connectdata *conn,                                          int pop3code,  | 
