From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Riccardo Murri" Newsgroups: gmane.emacs.devel Subject: Re: url-retrieve-synchronously randomly fails on https URLs (patch included) Date: Mon, 29 Oct 2007 21:48:46 +0100 Message-ID: <1c34ba170710291348v36cb5b83ybbb4a7f988f486b1@mail.gmail.com> References: <20071027104716.E9BA773545@tanja.localdomain> <1c34ba170710280540g5b2a9983o33abfcba2843d95@mail.gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_1692_30795922.1193690926808" X-Trace: ger.gmane.org 1193690961 1757 80.91.229.12 (29 Oct 2007 20:49:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 29 Oct 2007 20:49:21 +0000 (UTC) Cc: emacs-devel@gnu.org To: rms@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Oct 29 21:49:23 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1ImbXt-0000Ln-3w for ged-emacs-devel@m.gmane.org; Mon, 29 Oct 2007 21:49:13 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ImbXj-00031C-Ic for ged-emacs-devel@m.gmane.org; Mon, 29 Oct 2007 16:49:03 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1ImbXX-0002ud-6K for emacs-devel@gnu.org; Mon, 29 Oct 2007 16:48:51 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1ImbXW-0002u3-CF for emacs-devel@gnu.org; Mon, 29 Oct 2007 16:48:50 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ImbXW-0002tw-6E for emacs-devel@gnu.org; Mon, 29 Oct 2007 16:48:50 -0400 Original-Received: from wa-out-1112.google.com ([209.85.146.182]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1ImbXV-0003TD-3D for emacs-devel@gnu.org; Mon, 29 Oct 2007 16:48:49 -0400 Original-Received: by wa-out-1112.google.com with SMTP id k34so2261428wah for ; Mon, 29 Oct 2007 13:48:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; bh=jaDPs6awImDcuahFQ+RGKLZ0kTtBKcJtv2QnUxS4pkk=; b=TP2kOylKTiXKod4P7avPq6fzPEbdXMEVPbK8cc7yNFBpG8Jx3nyn10veQA+VEf8gdjOsX46VE4JvRWv1dJZ1pjva5LUpGS9mBhA9JUWxG2k7AOKGt/wTnhPvl9BizE9yd2HUDPvhjSF7aG+N18jZd61EdSu931obq1rNA9nSXh8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=sDK8aEuCZMQN92eJQ2BbxrozcXOQM6b4rb6MP8cQJm3WkvM5cEo36bJaEupuWhxRFIVXAu3TQrVwoD3SYXoQufE29FUdkAPwLT/mXyBYeoKarSKYwvgwvHaPqThZ7oezno7/92FiYlIB8931DLfM3YNodf88zl621uptcDdwj1g= Original-Received: by 10.114.194.1 with SMTP id r1mr385382waf.1193690926802; Mon, 29 Oct 2007 13:48:46 -0700 (PDT) Original-Received: by 10.114.75.13 with HTTP; Mon, 29 Oct 2007 13:48:46 -0700 (PDT) In-Reply-To: X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 2) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:82096 Archived-At: ------=_Part_1692_30795922.1193690926808 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline > Besides, the code can be simpler. > Thanks for your suggestions; simplified patch to tls.el attached. A few questions below: > + ;; advance point to after all informational messages that > + ;; `openssl s_client' and `gnutls' print > + (lexical-let ((attempts tls-end-of-info-match-attempts) > + (start-of-data nil)) > > Why not ordinary let? Out of curiosity: why would ordinary `let' be better here? > + (not (= 0 (if (> attempts 0) (decf attempts) -1))) > > I think there should not be a limit -- it should just keep looping > until it finds what it is looking for. > Yes, but this will result in a endless loop if the regex does not match the program output for some reason (for instance, a new version of `gnutls' changes the wording of the messages). I understand that this problem may occur in many places, and that tls.el would already loop forever if `tls-success' does not match; but I would rather add more "watchdog" counters instead... Anyway, I removed the `attempts' counter and related code, as per your suggestion. -- Riccardo Murri, via Galeazzo Alessi 61, 00176 Roma ------=_Part_1692_30795922.1193690926808 Content-Type: text/plain; name=tls.el.diff Content-Transfer-Encoding: base64 X-Attachment-Id: f_f8dgqfcz Content-Disposition: attachment; filename=tls.el.diff LS0tIHNyYy9lbWFjczIyL2xpc3AvbmV0L3Rscy5lbAkyMDA3LTA4LTA1IDIxOjA2OjEyLjAwMDAw MDAwMCArMDIwMAorKysgZW1hY3MvbGlzcC90bHMuZWwJMjAwNy0xMC0yOSAxOToxNzozMy4wMDAw MDAwMDAgKzAxMDAKQEAgLTUxLDYgKzUxLDkgQEAKICAgKGF1dG9sb2FkICdmb3JtYXQtc3BlYyAi Zm9ybWF0LXNwZWMiKQogICAoYXV0b2xvYWQgJ2Zvcm1hdC1zcGVjLW1ha2UgImZvcm1hdC1zcGVj IikpCiAKKyhldmFsLXdoZW4tY29tcGlsZQorICAocmVxdWlyZSAncngpKSAgOyBmb3Igd3JpdGlu ZyByZWFkYWJsZSByZWdleHBzCisKICh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W50CisgICAgICAgICAgKGxldCAoKHN0YXJ0LW9mLWRhdGEgbmlsKSkKKyAgICAg ICAgICAgICh3aGlsZSAKKyAgICAgICAgICAgICAgICAobm90IChzZXRxIHN0YXJ0LW9mLWRhdGEg CisgICAgICAgICAgICAgICAgICAgICAgICAgICA7OyB0aGUgc3RyaW5nIG1hdGNoaW5nIGB0bHMt ZW5kLW9mLWluZm8nCisgICAgICAgICAgICAgICAgICAgICAgICAgICA7OyBtaWdodCBjb21lIGlu IHNlcGFyYXRlIGNodW5rcyBmcm9tCisgICAgICAgICAgICAgICAgICAgICAgICAgICA7OyBgYWNj ZXB0LXByb2Nlc3Mtb3V0cHV0Jywgc28gc3RhcnQgdGhlCisgICAgICAgICAgICAgICAgICAgICAg ICAgICA7OyBzZWFyY2ggd2hlcmUgYHRscy1zdWNjZXNzJyBlbmRlZAorICAgICAgICAgICAgICAg ICAgICAgICAgICAgKHNhdmUtZXhjdXJzaW9uCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg IChpZiAocmUtc2VhcmNoLWZvcndhcmQgdGxzLWVuZC1vZi1pbmZvIG5pbCB0KQorICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgKG1hdGNoLWVuZCAwKSkpKSkKKyAgICAgICAgICAgICAg KGFjY2VwdC1wcm9jZXNzLW91dHB1dCBwcm9jZXNzIDEpKQorICAgICAgICAgICAgKGlmIHN0YXJ0 LW9mLWRhdGEKKyAgICAgICAgICAgICAgICA7OyBtb3ZlIHBvaW50IHRvIHN0YXJ0IG9mIGNsaWVu dCBkYXRhCisgICAgICAgICAgICAgICAgKGdvdG8tY2hhciBzdGFydC1vZi1kYXRhKSkpCisgICAg ICAgICAgKHNldHEgZG9uZSBwcm9jZXNzKSkpKQogICAgIChtZXNzYWdlICJPcGVuaW5nIFRMUyBj b25uZWN0aW9uIHRvIGAlcycuLi4lcyIKLQkgICAgIGhvc3QgKGlmIGRvbmUgImRvbmUiICJmYWls ZWQiKSkKKyAgICAgICAgICAgICBob3N0IChpZiBkb25lICJkb25lIiAiZmFpbGVkIikpKQogICAg ICh3aGVuIHVzZS10ZW1wLWJ1ZmZlcgogICAgICAgKGlmIGRvbmUgKHNldC1wcm9jZXNzLWJ1ZmZl ciBwcm9jZXNzIG5pbCkpCiAgICAgICAoa2lsbC1idWZmZXIgYnVmZmVyKSkK ------=_Part_1692_30795922.1193690926808 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel ------=_Part_1692_30795922.1193690926808--