aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSteve Holme <steve_holme@hotmail.com>2013-03-12 13:09:03 +0000
committerSteve Holme <steve_holme@hotmail.com>2013-03-12 14:10:25 +0000
commite450f66a02d8ec296755e1bfd48bb03d5fcf5d1f (patch)
tree3a5284aa416c93b092ba8be1504e968b08be4d2c /lib
parent57ccdfa8d2bb6275388223f4676cd623ebd01697 (diff)
pop3: Fixed continuous wait when using --ftp-list
Don't initiate a transfer when using --ftp-list.
Diffstat (limited to 'lib')
-rw-r--r--lib/pop3.c33
1 files changed, 18 insertions, 15 deletions
diff --git a/lib/pop3.c b/lib/pop3.c
index 80cf139b3..34c5964a1 100644
--- a/lib/pop3.c
+++ b/lib/pop3.c
@@ -1085,6 +1085,7 @@ static CURLcode pop3_state_command_resp(struct connectdata *conn,
{
CURLcode result = CURLE_OK;
struct SessionHandle *data = conn->data;
+ struct POP3 *pop3 = data->state.proto.pop3;
struct pop3_conn *pop3c = &conn->proto.pop3c;
struct pingpong *pp = &pop3c->pp;
@@ -1105,25 +1106,27 @@ static CURLcode pop3_state_command_resp(struct connectdata *conn,
the strip counter here so that these bytes won't be delivered. */
pop3c->strip = 2;
- /* POP3 download */
- Curl_setup_transfer(conn, FIRSTSOCKET, -1, FALSE, NULL, -1, NULL);
+ if(pop3->transfer == FTPTRANSFER_BODY) {
+ /* POP3 download */
+ Curl_setup_transfer(conn, FIRSTSOCKET, -1, FALSE, NULL, -1, NULL);
- if(pp->cache) {
- /* The header "cache" contains a bunch of data that is actually body
- content so send it as such. Note that there may even be additional
- "headers" after the body */
+ if(pp->cache) {
+ /* The header "cache" contains a bunch of data that is actually body
+ content so send it as such. Note that there may even be additional
+ "headers" after the body */
- if(!data->set.opt_no_body) {
- result = Curl_pop3_write(conn, pp->cache, pp->cache_size);
- if(result)
- return result;
- }
+ if(!data->set.opt_no_body) {
+ result = Curl_pop3_write(conn, pp->cache, pp->cache_size);
+ if(result)
+ return result;
+ }
- /* Free the cache */
- Curl_safefree(pp->cache);
+ /* Free the cache */
+ Curl_safefree(pp->cache);
- /* Reset the cache size */
- pp->cache_size = 0;
+ /* Reset the cache size */
+ pp->cache_size = 0;
+ }
}
/* End of DO phase */