aboutsummaryrefslogtreecommitdiff
path: root/lib/pingpong.c
diff options
context:
space:
mode:
authorJiri Hruska <jirka@fud.cz>2013-02-14 19:36:43 +0100
committerSteve Holme <steve_holme@hotmail.com>2013-02-22 18:35:15 +0000
commitcd65ecb2e8a6d4c65be9e5f08e36ed4960c3bf0f (patch)
tree545e5cf84716a4833a14d2360f7a46393c804aa3 /lib/pingpong.c
parent44a3cdb9db1f0a92ae7423b650b43ce9298d7e8e (diff)
pingpong: Introduce Curl_pp_moredata()
A simple function to test whether the PP is not sending and there are still more data in its receiver cache. This will be later utilized to: 1) Change Curl_pp_multi_statemach() and Curl_pp_easy_statemach() to not test socket state and just call user's statemach_act() function when there are more data to process, because otherwise the task would just hang, waiting for more data from the socket. 2) Allow PP users to read multiple responses by looping as long as there are more data available and current phase is not finished. (Currently needed for correct processing of IMAP SELECT responses.)
Diffstat (limited to 'lib/pingpong.c')
-rw-r--r--lib/pingpong.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/pingpong.c b/lib/pingpong.c
index 4b10e845e..69834da7d 100644
--- a/lib/pingpong.c
+++ b/lib/pingpong.c
@@ -503,6 +503,10 @@ CURLcode Curl_pp_disconnect(struct pingpong *pp)
return CURLE_OK;
}
+bool Curl_pp_moredata(struct pingpong *pp)
+{
+ return (!pp->sendleft && pp->cache && pp->nread_resp < pp->cache_size);
+}
#endif