emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: url-retrieve-synchronously randomly fails on https URLs (patch inclu


From: Richard Stallman
Subject: Re: url-retrieve-synchronously randomly fails on https URLs (patch included)
Date: Sat, 27 Oct 2007 19:41:39 -0400

    I traced down the bug to `open-tls-stream', which returns immediately
    after having seen the regexp `tls-success' in the buffer.  However,
    both `openssl s_client' and `gnutls' print more information after that
    line, thus `open-tls-stream' may occasionally return the buffer to the
    caller when point is still amidst openssl/gnutls output.  

    A solution is to have `open-tls-stream' wait a little more to accept
    output; after applying the patch below I cannot trigger the error
    anymore.

+        (if (not done)
+            (delete-process process)
+          ;; both `openssl s_client' and `gnutls' print some more info
+          ;; after the line matched by regexp `tls-success'; wait here
+          ;; a bit more, so we can be sure that point is at the end of
+          ;; it all, before handing the buffer back to caller
+          (accept-process-output process 1)
+          (setq done process))))

This is not totally reliable, because it is possible for
accept-process-output to get just part of the output.
That may be unlikely, which is why you have not seen it happen,
but it is possible.

So here is another suggestion.  Can you change the `tls-success'
regexp so that it matches all the text that openssl or gnutls
would produce?  (You might need to use \(...\|...\) to match
each on separately.)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]