-#ifndef __PINGPONG_H
-#define __PINGPONG_H
+#ifndef HEADER_CURL_PINGPONG_H
+#define HEADER_CURL_PINGPONG_H
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2010, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2013, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
*
***************************************************************************/
-#include <stdarg.h>
-
-#include "setup.h"
+#include "curl_setup.h"
#if !defined(CURL_DISABLE_IMAP) || !defined(CURL_DISABLE_FTP) || \
!defined(CURL_DISABLE_POP3) || !defined(CURL_DISABLE_SMTP)
/* forward-declaration, this is defined in urldata.h */
struct connectdata;
+typedef enum {
+ FTPTRANSFER_BODY, /* yes do transfer a body */
+ FTPTRANSFER_INFO, /* do still go through to get info/headers */
+ FTPTRANSFER_NONE, /* don't get anything and don't get info */
+ FTPTRANSFER_LAST /* end of list marker, never used */
+} curl_pp_transfer;
+
/*
* 'pingpong' is the generic struct used for protocols doing server<->client
* conversations in a back-and-forth style such as FTP, IMAP, POP3, SMTP etc.
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);
};
/*
- * Curl_pp_multi_statemach()
- *
- * called repeatedly until done when the multi interface is used.
- */
-CURLcode Curl_pp_multi_statemach(struct pingpong *pp);
-
-/*
- * Curl_pp_easy_statemach()
+ * Curl_pp_statemach()
*
- * called repeatedly until done when the easy interface is used.
+ * called repeatedly until done. Set 'wait' to make it wait a while on the
+ * socket if there's no traffic.
*/
-CURLcode Curl_pp_easy_statemach(struct pingpong *pp);
-
+CURLcode Curl_pp_statemach(struct pingpong *pp, bool block);
/* initialize stuff to prepare for reading a fresh new response */
void Curl_pp_init(struct pingpong *pp);
* the string should not have any CRLF appended, as this function will
* append the necessary things itself.
*
- * NOTE: we build the command in a fixed-length buffer, which sets length
- * restrictions on the command!
- *
* made to never block
*/
CURLcode Curl_pp_sendf(struct pingpong *pp,
* the string should not have any CRLF appended, as this function will
* append the necessary things itself.
*
- * NOTE: we build the command in a fixed-length buffer, which sets length
- * restrictions on the command!
- *
* made to never block
*/
CURLcode Curl_pp_vsendf(struct pingpong *pp,
int Curl_pp_getsock(struct pingpong *pp, curl_socket_t *socks,
int numsocks);
-#endif /* __PINGPONG_H */
+
+/***********************************************************************
+ *
+ * Curl_pp_moredata()
+ *
+ * Returns whether there are still more data in the cache and so a call
+ * to Curl_pp_readresp() will not block.
+ */
+bool Curl_pp_moredata(struct pingpong *pp);
+
+#endif /* HEADER_CURL_PINGPONG_H */