aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2008-05-12 21:43:24 +0000
committerDaniel Stenberg <daniel@haxx.se>2008-05-12 21:43:24 +0000
commit514592b89207e83d13b5a4e79bc247aa6f74c4b7 (patch)
tree9c9df12cf0f9b8f5e2aa835c4379ae7be9e3805d /include
parentd72efff878a352e24d3a7cc8cf7c2f8b0b65f409 (diff)
- Introducing curl_easy_send() and curl_easy_recv(). They can be used to send
and receive data over a connection previously setup with curl_easy_perform() and its CURLOPT_CONNECT_ONLY option. The sendrecv.c example was added to show how they can be used.
Diffstat (limited to 'include')
-rw-r--r--include/curl/curl.h2
-rw-r--r--include/curl/easy.h24
2 files changed, 25 insertions, 1 deletions
diff --git a/include/curl/curl.h b/include/curl/curl.h
index 6fcc34faf..042367466 100644
--- a/include/curl/curl.h
+++ b/include/curl/curl.h
@@ -447,6 +447,8 @@ typedef enum {
CURLE_SSL_SHUTDOWN_FAILED, /* 80 - Failed to shut down the SSL
connection */
+ CURLE_AGAIN, /* 81 - socket is not ready for send/recv,
+ wait till it's ready and try again */
CURL_LAST /* never use! */
} CURLcode;
diff --git a/include/curl/easy.h b/include/curl/easy.h
index 17de21070..88aa0e655 100644
--- a/include/curl/easy.h
+++ b/include/curl/easy.h
@@ -7,7 +7,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2004, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2008, 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
@@ -74,6 +74,28 @@ CURL_EXTERN CURL* curl_easy_duphandle(CURL *curl);
*/
CURL_EXTERN void curl_easy_reset(CURL *curl);
+/*
+ * NAME curl_easy_recv()
+ *
+ * DESCRIPTION
+ *
+ * Receives data from the connected socket. Use after successful
+ * curl_easy_perform() with CURLOPT_CONNECT_ONLY option.
+ */
+CURL_EXTERN CURLcode curl_easy_recv(CURL *curl, void *buffer, size_t buflen,
+ size_t *n);
+
+/*
+ * NAME curl_easy_send()
+ *
+ * DESCRIPTION
+ *
+ * Sends data over the connected socket. Use after successful
+ * curl_easy_perform() with CURLOPT_CONNECT_ONLY option.
+ */
+CURL_EXTERN CURLcode curl_easy_send(CURL *curl, const void *buffer,
+ size_t buflen, size_t *n);
+
#ifdef __cplusplus
}
#endif