Hi,

I’d guess curl tries to retrieve the body (until it sees a terminating dot) 
and, since UIDL with arg doesn’t have a body, it will wait indefinitely.
Did you try with CURLOPT_NOBODY set to 1?

Best,

Patrick

Von: curl-library <curl-library-boun...@lists.haxx.se> Im Auftrag von ?????? - 
via curl-library
Gesendet: Dienstag, 30. Mai 2023 09:31
An: curl-library@lists.haxx.se
Cc: Сергей - <tatarintsev...@gmail.com>
Betreff: POP3: UIDL for message


I'm trying to get a UIDL via POP3 for a specific message, but libcurl freezes. 
Receiving UIDL for all messages works fine.

My simple example:

    CURL *curl;

    CURLcode res = CURLE_OK;

    curl = curl_easy_init();

    char* cmd1="UIDL";

    curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);

    curl_easy_setopt(curl, CURLOPT_USERNAME, user);

    curl_easy_setopt(curl, CURLOPT_PASSWORD, password);

    curl_easy_setopt(curl, CURLOPT_URL, host);

    curl_easy_setopt(curl, CURLOPT_HEADERFUNCTION, curl_response_headers);

    curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, curl_read);

    curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, cmd1);

    res = curl_easy_perform(curl);
/* Here we successfully receive some headers+data like this
1 000002885ffbcd35

2 000002895ffbcd35

3 0000028a5ffbcd35
*/

    // but if i want to get uidl for specific message:

    char* cmd2="UIDL 1";

    curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);

    curl_easy_setopt(curl, CURLOPT_USERNAME, user);

    curl_easy_setopt(curl, CURLOPT_PASSWORD, password);

    curl_easy_setopt(curl, CURLOPT_URL, host);

    curl_easy_setopt(curl, CURLOPT_HEADERFUNCTION, curl_response_headers);

    curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, curl_read);

    curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, cmd2);

    res = curl_easy_perform(curl);
/*i receive headers with (that's actually expected)
+OK 1 000002885ffbcd35#015
and curl_easy_perform() freezes until timeout reached
*/

How i can correctly receive uidl for message
-- 
Unsubscribe: https://lists.haxx.se/mailman/listinfo/curl-library
Etiquette:   https://curl.se/mail/etiquette.html
  • POP3: UIDL for message Сергей - via curl-library
    • AW: POP3: UIDL for message Patrick Schlangen via curl-library

Reply via email to