unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Mark A. Hershberger" <mah@everybody.org>
Subject: Re: encoding and content-length for url-http.el
Date: Fri, 10 Jun 2005 11:53:45 -0400	[thread overview]
Message-ID: <1118418825.8854.49.camel@localhost.localdomain> (raw)
In-Reply-To: <1118418076.8854.41.camel@localhost.localdomain>


[-- Attachment #1.1.1: Type: text/plain, Size: 880 bytes --]

On Fri, 2005-06-10 at 11:46 -0400, Mark A. Hershberger wrote:
> Could I get input on the following patch before I apply it?  The first
> part (using string-bytes instead of length) seems like a no-brainer.
> The second part, I'm less sure about.

Full patch included this time.

And a fuller explanation.

I've come across circumstances where it appears that url-http.el isn't
doing the right thing.  For instance, I'm using xml-rpc to post weblog
entries that contain unicode quotes.  I need these changes to get it to
do the right thing.  For (a little) more information, see
<http://elisp.info/archive/80614312>.

-- 
http://mah.everybody.org/weblog/
GPG Fingerprint: 7E15 362D A32C DFAB E4D2  B37A 735E F10A 2DFC BFF5
More people are killed every year by pigs than by sharks, which shows
you how good we are at evaluating risk. -- Bruce Schneier






[-- Attachment #1.1.2: tmp.diff --]
[-- Type: text/x-patch, Size: 1618 bytes --]

Index: lisp/url/url-http.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/url/url-http.el,v
retrieving revision 1.14
diff -u -r1.14 url-http.el
--- lisp/url/url-http.el	4 Jun 2005 18:37:16 -0000	1.14
+++ lisp/url/url-http.el	10 Jun 2005 18:45:05 -0000
@@ -259,7 +259,7 @@
 	   (if url-request-data
 	       (concat
 		"Content-length: " (number-to-string
-				    (length url-request-data))
+				    (string-bytes url-request-data))
 		"\r\n"))
 	   ;; End request
 	   "\r\n"
@@ -1066,6 +1066,9 @@
 	(set-process-buffer connection buffer)
 	(set-process-sentinel connection 'url-http-end-of-document-sentinel)
 	(set-process-filter connection 'url-http-generic-filter)
+	(set-process-coding-system connection
+				   (detect-coding-string url-request-data t)
+				   url-request-coding-system)
 	(process-send-string connection (url-http-create-request url))))
     buffer))
 
Index: lisp/url/url-vars.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/url/url-vars.el,v
retrieving revision 1.9
diff -u -r1.9 url-vars.el
--- lisp/url/url-vars.el	9 Feb 2005 15:50:36 -0000	1.9
+++ lisp/url/url-vars.el	10 Jun 2005 18:45:05 -0000
@@ -218,6 +218,8 @@
 
 (defvar url-request-data nil "Any data to send with the next request.")
 
+(defvar url-request-coding-system 'binary "The coding system to use for the request.")
+
 (defvar url-request-extra-headers nil
   "A list of extra headers to send with the next request.
 Should be an assoc list of headers/contents.")

[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

[-- Attachment #2: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

  reply	other threads:[~2005-06-10 15:53 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-10 15:41 encoding and content-length for url-http.el Mark A. Hershberger
2005-06-10 15:53 ` Mark A. Hershberger [this message]
2005-06-10 19:47 ` Stefan Monnier
2005-06-10 17:14   ` Mark A. Hershberger
2005-06-10 21:22     ` Stefan Monnier
2005-06-16  4:21       ` Mark A. Hershberger
2005-06-16  7:05         ` Kenichi Handa
2005-06-16 16:05           ` Mark A. Hershberger
2005-06-11 11:06 ` Kenichi Handa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1118418825.8854.49.camel@localhost.localdomain \
    --to=mah@everybody.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).