-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Long delay running pop3 LIST #14201
Comments
I tested previous versions:
Summary:
Hopefully this helps to determine the cause. |
I wrote up a new test case that lists 1000 messages with POP3 (#14297) but it does not reproduce for me! |
@ralfjunker any chance you can retry with the latest curl and see if this works for you as well as it does for me? |
I just tried with curl v8.9.1 and is shows the same 2 minute pause after 99 messages before it continues to print the remaining messages without delay, up to the total of about 300. Thanks for the test case. I was afraid that my findings would be difficult to reproduce. Feel free to close this issue, I can reopen when I have time for more testing and come up with new findings. |
Could you give us a trace with |
Hi, I have almost the same problem with pop3, with the last curl official version 8.9.1. The payload starts, then a lock of 10 minutes, and the rest of the payload. Thx |
Thanks! That gives some insight: @bagder The server sends the complete response to the command of 2706 bytes. But Then it returns and polling the socket will give no event, as the data is pending in the SSL buffers. I suspect the connection timeout just triggers another run which consumes the rest of the response. Should pingpong expire RUN_NOW the transfer when there is data pending? I am not highly familiar with pingpong and its internals.... |
Great analysis @icing. It seems this is exactly what is happening.
Maybe we can tweak |
@ralfjunker any chance you can do a build with a test patch to see if it makes any difference for you? diff --git a/lib/transfer.c b/lib/transfer.c
index 46fde236d..70149de69 100644
--- a/lib/transfer.c
+++ b/lib/transfer.c
@@ -120,13 +120,15 @@ static int data_pending(struct Curl_easy *data)
struct connectdata *conn = data->conn;
if(conn->handler->protocol&PROTO_FAMILY_FTP)
return Curl_conn_data_pending(data, SECONDARYSOCKET);
- /* in the case of libssh2, we can never be really sure that we have emptied
- its internal buffers so we MUST always try until we get EAGAIN back */
- return conn->handler->protocol&(CURLPROTO_SCP|CURLPROTO_SFTP) ||
+ /* in the case of SSH, we can never be really sure that we have emptied its
+ internal buffers so we MUST always try until we get EAGAIN back */
+ return conn->handler->protocol&(CURLPROTO_SCP|
+ CURLPROTO_SFTP|
+ CURLPROTO_POP3) ||
Curl_conn_data_pending(data, FIRSTSOCKET);
}
/*
* Check to see if CURLOPT_TIMECONDITION was met by comparing the time of the |
I was able to build from GIT with schannel. The patch does not fix the delay. Some observations:
Line 233 in 88727f7
is called literally thousands of times and always returns 0. Outside the delay, it almost never returns 0.
Maybe this helps. |
As the data might be held by TLS buffers, leaving some and expecting to get called again is error prone. Reported-by: ralfjunker on github Fixes #14201
@ralfjunker it would be great if you could take the PR #14597 on a spin. I have tried to reproduce this case in a local test case (by adding TLS to test case 993) but failed so I can't know for sure I am actually addressing the correct case you experience. |
👍 The PR works well with the pop3 LIST request, there is no delay. 👎 The PR causes still has a delay of almost exactly 2 minutes for the pop3 STAT request. Command: In the case of STAT, the output is short and the delay happens after all output is written. See the To reproduce, maybe it helps to open a free mail account: https://en.wikipedia.org/wiki/GMX_Mail |
Sorry, are you saying this PR adds that STAT delay or that it was there already before and this fix does not fix it? You did not mention any STAT delay before. |
Then I think we should make a new separate issue for the STAT problem because it is evidently a different one, and we keep this for the LIST delay. |
I did this
curl --ssl-reqd --insecure -u username:password pop3s://pop.gmx.net
I expected the following
I expect a list of message IDs and message size. The list does indeed shows, but only up to message number 96. Then the display stops in the middle of the line, like here:
Surprisingly, after at least 30 seconds of inactivity, curl continues. It completes the truncated line and writes all remaining lines with no further delay (up to message 222, in my case).
I have seen the same delay in other pop3 contexts, but I am not able to reproduce it there. I hope you can see my findings.
curl/libcurl version
curl 8.8.0 (x86_64-w64-mingw32) libcurl/8.8.0 LibreSSL/3.9.2 zlib/1.3.1 brotli/1.1.0 zstd/1.5.6 WinIDN libpsl/0.21.5 libssh2/1.11.0 nghttp2/1.62.1 ngtcp2/1.6.0 nghttp3/1.4.0
Release-Date: 2024-05-22
Protocols: dict file ftp ftps gopher gophers http https imap imaps ipfs ipns ldap ldaps mqtt pop3 pop3s rtsp scp sftp smb smbs smtp smtps telnet tftp ws wss
Features: alt-svc AsynchDNS brotli HSTS HTTP2 HTTP3 HTTPS-proxy IDN IPv6 Kerberos Largefile libz NTLM PSL SPNEGO SSL SSPI threadsafe UnixSockets zstd
Note: This is the curl 8.8.0 binary from https://curl.se/windows/dl-8.8.0_3/curl-8.8.0_3-win64-mingw.zip.
operating system
Windows 11, 64 bit.
The text was updated successfully, but these errors were encountered: