From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alex Kost Newsgroups: gmane.emacs.bugs Subject: bug#16960: 24.3.50; Infinite loop in url-retrieve-synchronously if method is POST and response status is 301/302 Date: Fri, 07 Mar 2014 19:25:30 +0400 Message-ID: <878usmni8l.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1394205980 23822 80.91.229.3 (7 Mar 2014 15:26:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 7 Mar 2014 15:26:20 +0000 (UTC) To: 16960@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Mar 07 16:26:27 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1WLwfD-00011V-6D for geb-bug-gnu-emacs@m.gmane.org; Fri, 07 Mar 2014 16:26:19 +0100 Original-Received: from localhost ([::1]:37087 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WLwfC-00073t-OX for geb-bug-gnu-emacs@m.gmane.org; Fri, 07 Mar 2014 10:26:18 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49435) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WLwf1-0006t9-GM for bug-gnu-emacs@gnu.org; Fri, 07 Mar 2014 10:26:14 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WLwex-0008Sr-4k for bug-gnu-emacs@gnu.org; Fri, 07 Mar 2014 10:26:07 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:53847) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WLwex-0008Sh-1u for bug-gnu-emacs@gnu.org; Fri, 07 Mar 2014 10:26:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1WLwew-0001Rp-CQ for bug-gnu-emacs@gnu.org; Fri, 07 Mar 2014 10:26:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Alex Kost Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 07 Mar 2014 15:26:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 16960 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.13942059585553 (code B ref -1); Fri, 07 Mar 2014 15:26:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 7 Mar 2014 15:25:58 +0000 Original-Received: from localhost ([127.0.0.1]:55029 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WLwes-0001RU-0Y for submit@debbugs.gnu.org; Fri, 07 Mar 2014 10:25:58 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:47642) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WLwep-0001RM-8y for submit@debbugs.gnu.org; Fri, 07 Mar 2014 10:25:55 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WLwek-0008Mg-LN for submit@debbugs.gnu.org; Fri, 07 Mar 2014 10:25:54 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:58335) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WLwek-0008MM-J8 for submit@debbugs.gnu.org; Fri, 07 Mar 2014 10:25:50 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49340) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WLweg-0006EE-89 for bug-gnu-emacs@gnu.org; Fri, 07 Mar 2014 10:25:50 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WLweb-0008LH-V1 for bug-gnu-emacs@gnu.org; Fri, 07 Mar 2014 10:25:46 -0500 Original-Received: from mail-la0-x22a.google.com ([2a00:1450:4010:c03::22a]:62162) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WLweb-0008L2-L6 for bug-gnu-emacs@gnu.org; Fri, 07 Mar 2014 10:25:41 -0500 Original-Received: by mail-la0-f42.google.com with SMTP id ec20so2934786lab.1 for ; Fri, 07 Mar 2014 07:25:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:mime-version:content-type; bh=3wwozrUPyyhRdJQVtD+FGLOUWNxkthn7RkV20YHPySA=; b=CEHt7aG85ToEQwJybL3C2m7t4ZP7rqL24eDFYX0laz/w1mMfVowufXZx4vMclh0cei Cpw5fqnN1asAlQCiadx6yfCcJ9A9AUKlHtfPMsgACiK8s5X4ZUmRA2DmpLSrKM/3G3HY O3lyleMHzmQA+mNswaaihIyF4J5TnW4glXKlka3HBe0uxI1lcSk9R0xMy1jmAj555FjA ovOL7MGGUQmLSvxv4AeOH+eEE3AcOTcO7MJPC0p6lB66V6YgEJTggwf/w2Y2i5kkOwog kyg7XpLblQk4T+BzfL7vTMtU4q/ztH+xivfPDXc+dUpx7jXDYoYc5chH+ucLCyipHCtr McxQ== X-Received: by 10.112.136.71 with SMTP id py7mr8256512lbb.26.1394205939623; Fri, 07 Mar 2014 07:25:39 -0800 (PST) Original-Received: from leviafan (128-70-206-28.broadband.corbina.ru. [128.70.206.28]) by mx.google.com with ESMTPSA id wv4sm1297441lbb.10.2014.03.07.07.25.37 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 07 Mar 2014 07:25:37 -0800 (PST) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:86623 Archived-At: --=-=-= Content-Type: text/plain The problem is the following: when I try to login to https://aur.archlinux.org with `url-retrieve-synchronously' (see the code below), Emacs freezes (C-g helps) because callback passed to `url-retrieve' is never called. AFAIU this happens because `url-http-parse-headers' returns nil if response status is 301/302/307 and method is not "HEAD" or "GET" (see ). At least the problem goes away when I add: (setq success t) after (or `moved-permanently `found `temporary-redirect) in `url-http-parse-headers'. Would it be OK to allow such requests? Recipe is simple but you need to have an account on for that: 1. emacs -Q 2. Evaluate (setq url-debug t) 3. Evaluate the following code: --=-=-= Content-Type: application/emacs-lisp Content-Disposition: inline Content-Transfer-Encoding: quoted-printable (defun url-post (url args &optional inhibit-cookies) "Send ARGS to URL as a POST request. ARGS is alist of field names and values to send. Return the buffer with the received data. If INHIBIT-COOKIES is non-nil, do not use saved cookies." (let ((url-request-method "POST") (url-request-extra-headers '(("Content-Type" . "application/x-www-form-urlencoded"))) (url-request-data (mapconcat (lambda (arg) (concat (url-hexify-string (car arg)) "=3D" (url-hexify-string (cdr arg)))) args "&"))) (url-retrieve-synchronously url inhibit-cookies))) (url-post "https://aur.archlinux.org/login" (list (cons "user" "") (cons "passwd" "") (cons "remember_me" "off")) t) --=-=-= Content-Type: text/plain 3. Emacs hangs; press C-g 4. In "*URL-DEBUG*" buffer you can see the line: http -> Finished parsing HTTP headers: nil In GNU Emacs 24.3.50.2 (i686-pc-linux-gnu, GTK+ Version 3.10.6) of 2014-02-02 on leviafan Windowing system distributor `The X.Org Foundation', version 11.0.11500000 Configured using: `configure --prefix=/home/alexx/usr' --=-=-=--