/* macro to check for the last line in an FTP server response */
#define LASTLINE(line) (STATUSCODE(line) && (' ' == line[3]))
-static int ftp_endofresp(struct pingpong *pp,
- int *code)
+static bool ftp_endofresp(struct connectdata *conn, char *line, size_t len,
+ int *code)
{
- char *line = pp->linestart_resp;
- size_t len = pp->nread_resp;
+ (void)conn;
if((len > 3) && LASTLINE(line)) {
*code = curlx_sltosi(strtol(line, NULL, 10));
- return 1;
+ return TRUE;
}
- return 0;
+
+ return FALSE;
}
static CURLcode ftp_readresp(curl_socket_t sockfd,
/* Function that checks for an ending IMAP status code at the start of the
given string but also detects various capabilities from the CAPABILITY
response including the supported authentication mechanisms. */
-static int imap_endofresp(struct pingpong *pp, int *resp)
+static bool imap_endofresp(struct connectdata *conn, char *line, size_t len,
+ int *resp)
{
- char *line = pp->linestart_resp;
- size_t len = pp->nread_resp;
- struct imap_conn *imapc = &pp->conn->proto.imapc;
+ struct imap_conn *imapc = &conn->proto.imapc;
const char *id = imapc->resptag;
size_t id_len = strlen(id);
size_t wordlen;
if(result)
return result;
- if(pp->endofresp(pp, code)) {
+ if(pp->endofresp(conn, pp->linestart_resp, perline, code)) {
/* This is the end of the last line, copy the last line to the
start of the buffer and zero terminate, for old times sake (and
krb4)! */
CURLcode (*statemach_act)(struct connectdata *conn);
- int (*endofresp)(struct pingpong *pp, int *code);
+ bool (*endofresp)(struct connectdata *conn, char *ptr, size_t len, int *code);
};
/*
given string, but also detects the APOP timestamp from the server greeting
as well as the supported authentication types and allowed SASL mechanisms
from the CAPA response. */
-static int pop3_endofresp(struct pingpong *pp, int *resp)
+static bool pop3_endofresp(struct connectdata *conn, char *line, size_t len,
+ int *resp)
{
- char *line = pp->linestart_resp;
- size_t len = strlen(pp->linestart_resp);
- struct connectdata *conn = pp->conn;
struct pop3_conn *pop3c = &conn->proto.pop3c;
size_t wordlen;
size_t i;
/* Function that checks for an ending SMTP status code at the start of the
given string, but also detects various capabilities from the EHLO response
including the supported authentication mechanisms. */
-static int smtp_endofresp(struct pingpong *pp, int *resp)
+static bool smtp_endofresp(struct connectdata *conn, char *line, size_t len,
+ int *resp)
{
- char *line = pp->linestart_resp;
- size_t len = strlen(pp->linestart_resp);
- struct connectdata *conn = pp->conn;
struct smtp_conn *smtpc = &conn->proto.smtpc;
int result = FALSE;
size_t wordlen;