Using pop3 custom command "DELE", curl loops by waiting for body data.
So I fixed the code using custom commands as follows.

*** pop3.c.orig    2012-04-26 00:29:20.000000000 +0900
--- pop3.c    2012-06-20 10:19:56.000000000 +0900
***************
*** 452,457 ****
--- 452,458 ----
  {
    CURLcode result = CURLE_OK;
    struct pop3_conn *pop3c = &conn->proto.pop3c;
+   struct FTP *pop3 = conn->data->state.proto.pop3;
    const char *command = NULL;
  
    /* Calculate the default command */
***************
*** 460,472 ****
  
      if(pop3c->mailbox[0] != '\0') {
        /* Message specific LIST so skip the BODY transfer */
-       struct FTP *pop3 = conn->data->state.proto.pop3;
        pop3->transfer = FTPTRANSFER_INFO;
      }
    }
    else
      command = "RETR";
  
    /* Send the command */
    if(pop3c->mailbox[0] != '\0')
      result = Curl_pp_sendf(&conn->proto.pop3c.pp, "%s %s",
--- 461,482 ----
  
      if(pop3c->mailbox[0] != '\0') {
        /* Message specific LIST so skip the BODY transfer */
        pop3->transfer = FTPTRANSFER_INFO;
      }
    }
    else
      command = "RETR";
  
+   /* check custom command */
+   if(pop3c->custom && pop3c->custom[0] != '\0' && strlen(pop3c->custom) == 4){
+     if(!memcmp("STAT", pop3c->custom, 4) || !memcmp("DELE", pop3c->custom, 4)
+       || !memcmp("NOOP", pop3c->custom, 4) || !memcmp("RSET", pop3c->custom, 
4)
+       || !memcmp("UIDL", pop3c->custom, 4)){
+       /* Message specific above so skip the BODY transfer */
+       pop3->transfer = FTPTRANSFER_INFO;
+     }
+   }
+ 
    /* Send the command */
    if(pop3c->mailbox[0] != '\0')
      result = Curl_pp_sendf(&conn->proto.pop3c.pp, "%s %s",

Thanks for reading.
Regards.
                                          
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html

Reply via email to