pingpong: Optimised the endofresp() function

Reworked the pp->endofresp() function so that the conndata, line and
line length are passed down to it just as with Curl_client_write()
rather than each implementation of the function having to query
these values.

Additionally changed the int return type to bool as this is more
representative of the function's usage.
This commit is contained in:
Steve Holme
2013-02-12 18:08:48 +00:00
parent 586f5d3614
commit b56c9eb48e
6 changed files with 15 additions and 20 deletions

View File

@@ -216,11 +216,9 @@ static void smtp_to_smtps(struct connectdata *conn)
/* 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;