diff -ru ../../curl-7.18.1/include/curl/easy.h ./include/curl/easy.h
--- ../../curl-7.18.1/include/curl/easy.h	2004-11-09 17:02:58.000000000 +0300
+++ ./include/curl/easy.h	2008-04-29 17:34:41.000000000 +0400
@@ -74,6 +74,29 @@
  */
 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, char *buffer, size_t reqlen,
+    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 char *buffer, size_t reqlen,
+    size_t *n);
+
+
 #ifdef  __cplusplus
 }
 #endif
diff -ru ../../curl-7.18.1/lib/easy.c ./lib/easy.c
--- ../../curl-7.18.1/lib/easy.c	2008-03-20 14:09:59.000000000 +0300
+++ ./lib/easy.c	2008-04-29 18:17:31.000000000 +0400
@@ -1046,3 +1046,94 @@
 }
 
 #endif /* CURL_DOES_CONVERSIONS */
+
+/*
+ * Receives data from the connected socket. Use after successful curl_easy_perform()
+ * with CURLOPT_CONNECT_ONLY option.
+ * Returns CURLE_OK on success, error code on error.
+ */
+CURLcode curl_easy_recv(CURL *curl, char *buffer, size_t reqlen, size_t *n)
+{
+    curl_socket_t sfd;
+    CURLcode ret;
+    int ret1;
+    ssize_t n1;
+    struct connectdata *c = NULL;
+    struct SessionHandle *data = (struct SessionHandle *)curl;
+    if(data == NULL)
+	return CURLE_RECV_ERROR;
+    /* only allow recv to be called on handles with CURLOPT_CONNECT_ONLY */
+    if(! data->set.connect_only)
+	return CURLE_RECV_ERROR;
+    
+    /* Get connectdata for the handle. Shamelessly stolen from getopt.c */
+    if((data->state.lastconnect != -1) &&
+       (data->state.connc->connects[data->state.lastconnect] != NULL))
+        c = data->state.connc->connects[data->state.lastconnect];
+    
+    if(c == NULL)
+	return CURLE_RECV_ERROR;
+
+    ret = Curl_getinfo(data, CURLINFO_LASTSOCKET, &sfd);
+
+    if(ret != CURLE_OK)
+	return ret;
+
+    if(sfd == -1)
+	return CURLE_RECV_ERROR;
+
+    *n = 0;
+    ret1 = Curl_read(c, sfd, buffer, reqlen, &n1);
+    if(ret1 == -1)
+	return CURLE_RECV_ERROR;
+    if(n1 == -1)
+	return CURLE_RECV_ERROR;
+
+    *n = (size_t)n1;
+
+    return CURLE_OK;							
+}
+
+/*
+ * Sends data over the connected socket. Use after successful curl_easy_perform()
+ * with CURLOPT_CONNECT_ONLY option.
+ */
+CURLcode curl_easy_send(CURL *curl, const char *buffer, size_t reqlen, size_t *n)
+{
+    curl_socket_t sfd;
+    CURLcode ret;
+    ssize_t n1;
+    struct connectdata *c = NULL;
+    struct SessionHandle *data = (struct SessionHandle *)curl;
+    if(data == NULL)
+	return CURLE_SEND_ERROR;
+    /* only allow send to be called on handles with CURLOPT_CONNECT_ONLY */
+    if(! data->set.connect_only)
+	return CURLE_SEND_ERROR;
+    
+    /* Get connectdata for the handle. Shamelessly stolen from getopt.c */
+    if((data->state.lastconnect != -1) &&
+       (data->state.connc->connects[data->state.lastconnect] != NULL))
+        c = data->state.connc->connects[data->state.lastconnect];
+
+    if(c == NULL)
+	return CURLE_SEND_ERROR;
+
+    ret = Curl_getinfo(data, CURLINFO_LASTSOCKET, &sfd);
+        
+    if(ret != CURLE_OK)
+	return ret;
+
+    if(sfd == -1)
+	return CURLE_SEND_ERROR;
+
+    *n = 0;
+    ret = Curl_write(c, sfd, buffer, reqlen, &n1);
+    if(n1 == -1)
+	return CURLE_SEND_ERROR;
+
+    *n = (size_t)n1;
+
+    return ret;
+}
+
