* tiny changes to url-cookie.el
@ 2005-06-22 15:31 Klaus Straubinger
2005-06-23 16:54 ` Richard M. Stallman
0 siblings, 1 reply; 6+ messages in thread
From: Klaus Straubinger @ 2005-06-22 15:31 UTC (permalink / raw)
There are two changes I would like to suggest for url-cookie.el:
1. The "autoload" in the line before the definition of
url-cookie-generate-header-lines is misspelled. Maybe it can be
removed altogether and replaced by an autoload statement in
url-http.el.
2. The function url-cookie-retrieve constructs its path-regexp with a
leading "^". This has lead to missing cookie retrievals for me;
could it simply be removed?
--
Klaus Straubinger
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: tiny changes to url-cookie.el
2005-06-22 15:31 tiny changes to url-cookie.el Klaus Straubinger
@ 2005-06-23 16:54 ` Richard M. Stallman
2005-06-27 15:01 ` Klaus Straubinger
[not found] ` <m3d5q7rhgz.fsf@P131831.SAP.Corp>
0 siblings, 2 replies; 6+ messages in thread
From: Richard M. Stallman @ 2005-06-23 16:54 UTC (permalink / raw)
Cc: emacs-devel
2. The function url-cookie-retrieve constructs its path-regexp with a
leading "^".
That function does not explain very clearly what it is supposed to do.
What does the argument PATH mean? Could you show me some examples
of it? Why is it wrong to add ^? Could you show me the specific
code you are talking about (the reference is somewhat ambiguous)?
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: tiny changes to url-cookie.el
2005-06-23 16:54 ` Richard M. Stallman
@ 2005-06-27 15:01 ` Klaus Straubinger
2005-06-28 4:17 ` Richard M. Stallman
[not found] ` <m3d5q7rhgz.fsf@P131831.SAP.Corp>
1 sibling, 1 reply; 6+ messages in thread
From: Klaus Straubinger @ 2005-06-27 15:01 UTC (permalink / raw)
[url-cookie-retrieve]
> That function does not explain very clearly what it is supposed to do.
> What does the argument PATH mean?
The whole topic is explained in more detail in the document
"http://home.netscape.com/newsref/std/cookie_spec.html" which
is referenced at the beginning of the file url-cookie.el.
In short, the PATH argument is meant to be the local part of the
internet site because sites maybe want to set and retrieve different
cookies for different parts of their site.
> Could you show me some examples of it? Why is it wrong to add ^?
I thought it would require paths starting from "/" (the site's root)
which could not always be true.
But now I have found the root of the problems I had with cookie
retrieval: The function url-http-create-request which builds the HTTP
request calls url-cookie-generate-header-lines already with the wrong
path - but only when dealing with a proxy. It sets a local variable
like this
(real-fname (if proxy-obj (url-recreate-url proxy-obj)
(url-filename url)))
i.e., if a proxy object is defined, the whole URL is used instead of
only the local part after the host name. The function url-filename
is used to get this part (unfortunately its name does not fit very
well its purpose in this case) and should be applied in the proxy case
as well.
Therefore, I think the two lines above should be replaced by
(real-fname (url-filename (if proxy-obj proxy-obj url)))
and no change to url-cookie-retrieve should be necessary. Sorry for the
confusion.
--
Klaus Straubinger
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: tiny changes to url-cookie.el
2005-06-27 15:01 ` Klaus Straubinger
@ 2005-06-28 4:17 ` Richard M. Stallman
0 siblings, 0 replies; 6+ messages in thread
From: Richard M. Stallman @ 2005-06-28 4:17 UTC (permalink / raw)
Cc: emacs-devel
In short, the PATH argument is meant to be the local part of the
internet site because sites maybe want to set and retrieve different
cookies for different parts of their site.
In that case, we shouldn't call it a "path"; GNU convention is to use
that term only for lists of directories to search. So I changed those
argument names just now. I also added a doc string which I could
figure out partly. But many functions in that file don't have doc
strings, and need them. Or the doc strings are very sketchy and not
clear.
Therefore, I think the two lines above should be replaced by
(real-fname (url-filename (if proxy-obj proxy-obj url)))
and no change to url-cookie-retrieve should be necessary. Sorry for the
confusion.
Thanks. I will install that change, hoping you're right.
(It is done more cleanly using `or' instead of `if'.)
^ permalink raw reply [flat|nested] 6+ messages in thread
[parent not found: <m3d5q7rhgz.fsf@P131831.SAP.Corp>]
* Re: tiny changes to url-cookie.el
[not found] ` <m3d5q7rhgz.fsf@P131831.SAP.Corp>
@ 2005-06-28 7:25 ` Klaus Straubinger
2005-06-29 3:58 ` Richard M. Stallman
0 siblings, 1 reply; 6+ messages in thread
From: Klaus Straubinger @ 2005-06-28 7:25 UTC (permalink / raw)
Thank you for applying my suggested changes so quickly.
Unfortunately, after this change URL retrievals over a proxy are no
longer possible.
url-http-create-request has to create a full URL for "GET" if the
connection is over a proxy. Therefore, something like the following
change has to be done:
--- url-http.el~ 2005-06-28 08:37:34.000000000 +0200
+++ url-http.el 2005-06-28 08:53:50.938624800 +0200
@@ -199,7 +199,9 @@
(setq request
(concat
;; The request
- (or url-request-method "GET") " " real-fname " HTTP/" url-http-version "\r\n"
+ (or url-request-method "GET") " "
+ (if proxy-obj (url-recreate-url proxy-obj) real-fname)
+ " HTTP/" url-http-version "\r\n"
;; Version of MIME we speak
"MIME-Version: 1.0\r\n"
;; (maybe) Try to keep the connection open
I am really sorry for such bad testing on my side.
--
Klaus Straubinger
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2005-06-29 3:58 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-06-22 15:31 tiny changes to url-cookie.el Klaus Straubinger
2005-06-23 16:54 ` Richard M. Stallman
2005-06-27 15:01 ` Klaus Straubinger
2005-06-28 4:17 ` Richard M. Stallman
[not found] ` <m3d5q7rhgz.fsf@P131831.SAP.Corp>
2005-06-28 7:25 ` Klaus Straubinger
2005-06-29 3:58 ` Richard M. Stallman
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).