From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Paul Pogonyshev Newsgroups: gmane.emacs.devel Subject: Re: URL library problem Date: Mon, 3 Oct 2005 20:53:01 +0300 Message-ID: <200510032053.01278.pogonyshev@gmx.net> References: <200510022132.54931.pogonyshev@gmx.net> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1128361558 27924 80.91.229.2 (3 Oct 2005 17:45:58 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 3 Oct 2005 17:45:58 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Oct 03 19:45:56 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EMUM3-0003RJ-L2 for ged-emacs-devel@m.gmane.org; Mon, 03 Oct 2005 19:43:59 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EMUM2-0007ny-UJ for ged-emacs-devel@m.gmane.org; Mon, 03 Oct 2005 13:43:58 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EMULB-0007Vv-Qj for emacs-devel@gnu.org; Mon, 03 Oct 2005 13:43:05 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EMUL8-0007V3-Ch for emacs-devel@gnu.org; Mon, 03 Oct 2005 13:43:04 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EMUL8-0007UY-1o for emacs-devel@gnu.org; Mon, 03 Oct 2005 13:43:02 -0400 Original-Received: from [213.165.64.20] (helo=mail.gmx.net) by monty-python.gnu.org with smtp (Exim 4.34) id 1EMUKR-0005Dg-By for emacs-devel@gnu.org; Mon, 03 Oct 2005 13:42:19 -0400 Original-Received: (qmail invoked by alias); 03 Oct 2005 17:42:16 -0000 Original-Received: from dialup.194.158.208.244.belpak.by (EHLO localhost.localdomain) [194.158.208.244] by mail.gmx.net (mp001) with SMTP; 03 Oct 2005 19:42:16 +0200 X-Authenticated: #16844820 Original-To: Stefan Monnier User-Agent: KMail/1.4.3 In-Reply-To: X-Y-GMX-Trusted: 0 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:43506 Archived-At: Stefan Monnier wrote: > > Would the patch below do the trick? > > No, it clearly wouldn't. Try this one instead. > > > Stefan > > > --- url-http.el=0925 ao=FB 2005 10:56:43 -0400=091.20 > +++ url-http.el=0903 oct 2005 11:26:27 -0400 > @@ -198,7 +198,12 @@ > ;; allows us to elide null lines directly, at the cost of making > ;; the layout less clear. > (setq request > -=09 (concat > + (mapconcat > + ;; We'd really want here `string-to-unibyte', so as to signa= l an > + ;; error if one of the strings contains a multibyte char. > + 'string-as-unibyte > + (delq nil > + (list > =09 ;; The request > =09 (or url-request-method "GET") " " > =09 (if proxy-obj (url-recreate-url proxy-obj) real-fname) > @@ -267,6 +272,7 @@ > =09 "\r\n" > =09 ;; Any data > =09 url-request-data)) > + "")) > (url-http-debug "Request is: \n%s" request) > request)) Yes, it works. I was thinking more along the lines of this patch: --- url-http.el=0924 Aug 2005 22:29:10 +0300=091.20 +++ url-http.el=0903 Oct 2005 20:37:50 +0300=09 @@ -264,9 +264,10 @@ request. =09=09=09=09 (length url-request-data)) =09=09"\r\n")) =09 ;; End request -=09 "\r\n" -=09 ;; Any data -=09 url-request-data)) +=09 "\r\n")) + (setq request (concat (encode-coding-string request 'binary t) +=09=09=09 ;; Any data +=09=09=09 url-request-data)) (url-http-debug "Request is: \n%s" request) request)) =20 @@ -1016,6 +1017,12 @@ CBARGS as the arguments." =09=09 url-http-chunked-start =09=09 url-http-chunked-counter =09=09 url-http-process)) + + (when (and url-request-data (multibyte-string-p url-request-data)) + (let ((ascii-string (encode-coding-string url-request-data 'iso-safe= ))) + (if (string=3D ascii-string url-request-data) +=09 (setq url-request-data ascii-string) +=09(error "`url-request-data' must be properly encoded or consist only o= f ASCII characters")))) (let ((connection (url-http-find-free-connection (url-host url) =09=09=09=09=09=09 (url-port url))) =09(buffer (generate-new-buffer (format " *http %s:%d*" I assume you will commit something solving it to CVS. Paul