From c6495bccbf7485d9088e994bf27cb2efd3b29d47 Mon Sep 17 00:00:00 2001 From: Steve Holme Date: Sun, 27 May 2012 10:54:13 +0100 Subject: pop3: Code tidy up before the introduction of authentication code Moved EOB definition into header file. Switched the logic around in pop3_endofresp() to allow for the introduction of auth-mechanism detection. Repositioned second and third function variables where they will fit within the 78 character line limit. Tidied up some comments. --- lib/pop3.h | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'lib/pop3.h') diff --git a/lib/pop3.h b/lib/pop3.h index e30c3b3b2..99b514e4c 100644 --- a/lib/pop3.h +++ b/lib/pop3.h @@ -26,15 +26,15 @@ * POP3 unique setup ***************************************************************************/ typedef enum { - POP3_STOP, /* do nothing state, stops the state machine */ - POP3_SERVERGREET, /* waiting for the initial greeting immediately after - a connect */ + POP3_STOP, /* do nothing state, stops the state machine */ + POP3_SERVERGREET, /* waiting for the initial greeting immediately after + a connect */ POP3_USER, POP3_PASS, POP3_STARTTLS, POP3_COMMAND, POP3_QUIT, - POP3_LAST /* never used */ + POP3_LAST /* never used */ } pop3state; /* pop3_conn is used for struct connection-oriented data in the connectdata @@ -52,12 +52,12 @@ struct pop3_conn { extern const struct Curl_handler Curl_handler_pop3; extern const struct Curl_handler Curl_handler_pop3s; -/* - * 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); +/* This is the 5-bytes End-Of-Body marker for POP3 */ +#define POP3_EOB "\x0d\x0a\x2e\x0d\x0a" +#define POP3_EOB_LEN 5 + +/* 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); #endif /* HEADER_CURL_POP3_H */ -- cgit v1.2.3