Commit graph

144 commits

Author SHA1 Message Date
Paul Eggert
7e09ef09a4 Update copyright year to 2015
Run admin/update-copyright.
2015-01-01 14:26:41 -08:00
Lars Magne Ingebrigtsen
14efb83188 Remove superfluous `gnutls-available-p' check
* lisp/url/url-http.el (url-http-parse-headers): `gnutls-available-p' is
now always available.
2014-12-12 11:48:29 +01:00
Lars Magne Ingebrigtsen
c6f03ed03d Fix a problem in url.el without GnuTLS
Fixes: debbugs:19346

* lisp/url/url-http.el (url-http-parse-headers): Check that
`gnutls-available-p' is defined.
2014-12-11 16:57:33 +01:00
Lars Magne Ingebrigtsen
0cc8da5cd8 Make the https logic in url-http work on redirects
(url-http-parse-headers): When being redirected, make sure we
flush the previous certificate.
2014-12-09 04:21:12 +01:00
Lars Magne Ingebrigtsen
d7e5255013 Make URL pass the TLS peer status to the caller
* lisp/url/url-http.el (url-http-parse-headers): Pass the GnuTLS
status of the connection to the caller.
2014-12-09 03:59:48 +01:00
Stefan Monnier
b76bea4c26 Various minor details accumulated over time
* lisp/info.el (Info-mode-map): Remove left-over binding.
* lisp/net/tramp.el (tramp-handle-make-symbolic-link): Mark unused arg.
* lisp/obsolete/gulp.el (gulp-create-m-p-alist): Remove unused var `mnt-tm'.
* lisp/progmodes/gud.el (gud-gdb-completions): Remove unused var `start'.
* lisp/url/url-http.el (url-http-activate-callback): Make debug more verbose.
* src/process.c: Whitespace and line-break nitpicks.
2014-12-08 15:02:26 -05:00
Lars Magne Ingebrigtsen
a345ff6bf2 Implement a new url parameter `url-request-noninteractive'
* url-http.el (url-http): Respect `url-request-noninteractive'.

* url-queue.el (url-queue-start-retrieve): Fetching through
url-queue should always be noninteractive.

* url-vars.el (url-request-noninteractive): New variable.
2014-11-23 15:05:18 +01:00
Ted Zlatanov
a7fde0e7e6 url-http.el (url-user-agent): Add :version. 2014-11-05 12:18:22 -05:00
Ted Zlatanov
d9f7c524b6 url-http.el: introduce url-user-agent
* url-http.el (url-user-agent): New variable, can be function or
string.  Suggested by Vibhav Pant <vibhavp@ubuntu.com>.

(url-http-user-agent-string): Use it.

* url-http.el (url-user-agent): New variable, can be function or
string.  Suggested by Vibhav Pant <vibhavp@ubuntu.com>.
2014-11-05 11:06:40 -05:00
Eli Zaretskii
8ca8fde8a2 Fix bug #18650 with warning about zlib when loading url-vars.el.
src/decompress.c (init_zlib_functions): Move the message about zlib
 being unavailable from here...
 (Fzlib_decompress_region): ...to here.

 lisp/url/url-http.el (url-http-create-request): Recheck zlib availability
 on windows-nt each time it might be required.
2014-10-07 20:18:07 +03:00
Ulf Jasper
98c58df832 Do not set url-gateway-method' in url-https'. (Bug#16543)
Currently, when `url-retrieve' is called for an https url it modifies
the variable `url-gateway-method'.  This has been changed to
explicitly pass the requested gateway method to other functions.

When `url-retrieve' is being processed then (via
`accept-process-output') another `url-retrieve' call from a pending
timer can be started.  The second call would always see the modified
`url-gateway-method' of the first one, which in general does not match
the url.

2014-09-28  Ulf Jasper  <ulf.jasper@web.de>

	* url-gw.el (url-open-stream): New optional parameter
	`gateway-method'.  If non-nil use it instead of global variable
	`url-gateway-method'.

	* url/url-http.el (url-http): New optional parameter
	`gateway-method', pass it to `url-http-find-free-connection'.
	(url-http-find-free-connection): New optional parameter
	gateway-method, pass it to `url-open-stream'.
	(url-https-create-secure-wrapper): Do not modify
	`url-gateway-method' but explicitly provide 'tls as gateway-method
	parameter to `url-https'.
2014-09-28 20:00:54 +02:00
Stefan Monnier
9949231fb0 Merge from emacs-24 2014-09-22 15:20:45 -04:00
Dmitry Gutov
35ee96fdcb Clarify url-http and url-retrieve-internal docstrings
* lisp/url/url-http.el (url-http): Same. 

* lisp/url/url.el (url-retrieve-internal): Clarify the docstring.

Fixes: debbugs:18116
2014-09-19 05:55:43 +04:00
Glenn Morris
9ac6d28ab8 Merge from emacs-24; up to 2014-06-11T19:33:14Z!rgm@gnu.org 2014-06-25 23:55:15 -07:00
Leo Liu
1d8bea6283 * lisp/url/url-handlers.el (url-http-parse-response): Remove unused autoload.
(url-insert-file-contents): Condition on url-http-response-status
for the HTTP/S specific part. 

* lisp/url/url-http.el (url-http-end-of-headers): Remove duplicate defvar.

Fixes: debbugs:17549
2014-06-26 12:00:56 +08:00
Glenn Morris
93a583ee13 Set Maintainer to emacs-devel in some lisp/url files. 2014-03-28 20:55:44 -04:00
Glenn Morris
32544aa413 * lisp/url/url-vars.el (url-bug-address): Make into an obsolete alias.
* lisp/urlurl-http.el (url-http-handle-authentication):
* lisp/url/url-news.el (url-news-fetch-message-id):
Use M-x report-emacs-bug in help messages.
2014-03-28 19:02:02 -04:00
Jarosław Rzeszótko
e3e52a0157 * lisp/url/url-http.el (url-http-create-request): Don't add extra \r\n after
http data.

Fixes: debbugs:16220
2014-01-08 13:29:16 -05:00
Paul Eggert
ba3189039a Update copyright year to 2014 by running admin/update-copyright. 2014-01-01 07:43:34 +00:00
Leo Liu
0bf29ba617 * url/url-util.el (url-pretty-length): Make obsolete and all uses
changed to file-size-human-readable.
2013-09-29 09:37:03 +08:00
Glenn Morris
ee8b701cae Fix typo in declaration 2013-09-17 22:10:21 -07:00
Glenn Morris
35cc47373e * lisp/url/url-http.el (zlib-decompress-region): Declare. 2013-09-17 21:44:44 -04:00
Glenn Morris
d6a0426625 Silence some url compilation warnings on systems without zlib
* url-http.el (url-handle-content-transfer-encoding):
* url-vars.el (url-mime-encoding-string): Silence compiler.
2013-09-13 00:01:55 -07:00
Lars Magne Ingebrigtsen
6c195442ea * url-http.el (url-http-parse-headers): Always place point at the
start of the buffer instead of just 80% of the time.
2013-08-14 15:03:25 +02:00
Lars Magne Ingebrigtsen
7699d09ec6 Rename zlib-decompress-gzipped-region' to zlib-decompress-region'.
Also support zlib-format compression.
2013-08-12 19:02:31 +02:00
Lars Magne Ingebrigtsen
8a44a18468 Add the zlib prefix to `decompress-gzipped-region' 2013-08-12 15:54:45 +02:00
Lars Magne Ingebrigtsen
6edea0a595 Add Content-Transfer gzip support to url
* url-http.el (url-handle-content-transfer-encoding): Support
decompressing gzipped content.

* url-vars.el (url-mime-encoding-string): If we have built-in gzip
support, say that we accept gzipped content.
2013-08-11 22:52:50 +02:00
Stefan Monnier
3a3f390d1b * lisp/url/url-http.el (status): Remove, unused.
(success): Remove var.
(url-http-handle-authentication): Return the value that `success'
should take instead of setting `success' directly.  Don't set `status'
since it's not used.
(url-http-parse-headers): Avoid unneeded setq.
Move the `setq success'.
(url-http): Use pcase.
(url-http-file-exists-p): Simplify.
2013-07-22 00:06:21 -04:00
Glenn Morris
fe2219e202 url-http-wait-for-headers-change-function fix for bug#13598
* lisp/url/url-http.el (url-http-wait-for-headers-change-function):
Avoid prematurely finding the end of headers when they arrive line-by-line.
2013-02-15 21:05:32 -05:00
Paul Eggert
0877d0dc24 Merge from emacs-24; up to 2012-12-06T01:39:03Z!monnier@iro.umontreal.ca 2013-01-02 08:13:04 -08:00
Paul Eggert
ab422c4d68 Update copyright notices for 2013. 2013-01-01 09:11:05 +00:00
Takafumi Arakaki
33d359875a Two fixes for the URL library (tiny change).
* url-expand.el (url-default-expander): Don't calculate a default
url port before checking url-type.

* url-http.el (url-http-end-of-document-sentinel): Bind relevant
url-request-* variables around the call to url-http.

Fixes: debbugs:11469 debbugs:12374
2012-12-22 10:59:08 +08:00
Chong Yidong
b1367cba38 Doc fix for url-http.
* url-http.el (url-http):
* url.el (url-retrieve-internal): Doc fix.

Fixes: debbugs:6407
2012-10-13 17:37:25 +08:00
Stefan Monnier
e79186e5b9 * lisp/url/url-http.el (url-http-user-agent-string): Leak less info.
(url-http, url-http-file-exists-p, url-http-file-readable-p)
(url-http-file-attributes, url-http-options, url-https-default-port)
(url-https-asynchronous-p): Don't autoload.
2012-10-01 23:48:01 -04:00
Stefan Monnier
89534796c8 * lisp/url/url-http.el (url-http-parse-headers): Re-enable file-name-handlers.
Fixes: debbugs:11981
2012-08-14 10:54:51 -04:00
Jason Rumney
4ed1626da6 * lisp/url/url-http.el (url-http-create-request): Use url-http-proxy to
look up proxy credentials.
2012-08-11 22:48:37 +08:00
Stefan Monnier
a464a6c73a More CL cleanups and reduction of use of cl.el.
* woman.el, winner.el, vc/vc-rcs.el, vc/vc-hooks.el, vc/vc-hg.el:
* vc/vc-git.el, vc/vc-dir.el, vc/vc-bzr.el, vc/vc-annotate.el:
* textmodes/tex-mode.el, textmodes/sgml-mode.el, tar-mode.el:
* strokes.el, ses.el, server.el, progmodes/js.el, progmodes/gdb-mi.el:
* progmodes/flymake.el, progmodes/ebrowse.el, progmodes/compile.el:
* play/tetris.el, play/snake.el, play/pong.el, play/landmark.el:
* play/hanoi.el, play/decipher.el, play/5x5.el, nxml/nxml-mode.el:
* net/secrets.el, net/quickurl.el, midnight.el, mail/footnote.el:
* image-dired.el, ibuffer.el, ibuf-macs.el, ibuf-ext.el, hexl.el:
* eshell/eshell.el, eshell/esh-io.el, eshell/esh-ext.el:
* eshell/esh-cmd.el, eshell/em-ls.el, eshell/em-hist.el:
* eshell/em-cmpl.el, eshell/em-banner.el:
* url/url.el, url/url-queue.el, url/url-parse.el, url/url-http.el:
* url/url-future.el, url/url-dav.el, url/url-cookie.el:
* calendar/parse-time.el, test/eshell.el: Use cl-lib.
* wid-browse.el, wdired.el, vc/vc.el, vc/vc-mtn.el, vc/vc-cvs.el:
* vc/vc-arch.el, tree-widget.el, textmodes/texinfo.el:
* textmodes/refill.el, textmodes/css-mode.el, term/tvi970.el:
* term/ns-win.el, term.el, shell.el, ps-samp.el:
* progmodes/perl-mode.el, progmodes/pascal.el, progmodes/gud.el:
* progmodes/glasses.el, progmodes/etags.el, progmodes/cwarn.el:
* play/gamegrid.el, play/bubbles.el, novice.el, notifications.el:
* net/zeroconf.el, net/xesam.el, net/snmp-mode.el, net/mairix.el:
* net/ldap.el, net/eudc.el, net/browse-url.el, man.el:
* mail/mailheader.el, mail/feedmail.el:
* url/url-util.el, url/url-privacy.el, url/url-nfs.el, url/url-misc.el:
* url/url-methods.el, url/url-gw.el, url/url-file.el, url/url-expand.el:
Dont use CL.
* ibuf-ext.el (ibuffer-mark-old-buffers): Use float-time.
* eshell/esh-opt.el (eshell-eval-using-options): Quote code with
`lambda' rather than with `quote'.
(eshell-do-opt): Adjust accordingly.
(eshell-process-option): Simplify.
* eshell/esh-var.el:
* eshell/em-script.el: Require `esh-opt' for eshell-eval-using-options.
* emacs-pcase.el (pcase--dontcare-upats, pcase--let*)
(pcase--expand, pcase--u1): Rename pcase's internal `dontcare' pattern
to `pcase--dontcare'.
* emacs-cl.el (labels): Mark obsolete.
(cl--letf, letf): Move to cl-lib.
(cl--letf*, letf*): Remove.
* emacs-cl-lib.el (cl-nth-value): Use defalias.
* emacs-cl-macs.el (cl-dolist, cl-dotimes): Add indent rule.
(cl-progv): Rewrite.
(cl--letf, cl-letf): Move from cl.el.
(cl-letf*): New macro.
* emacs-cl-extra.el (cl--progv-before, cl--progv-after): Remove.
2012-07-11 19:13:41 -04:00
Leo Liu
9979ea1c6c * lisp/url/url-http.el (url-http-codes): Fix mal-formed defconst. 2012-05-25 18:19:01 +08:00
Chong Yidong
ce7b18ec41 Improve RFC 3986 conformance of url package.
Fix 2012-04-10 change to url.el.

* url-http.el (url-http-create-request): Ignore obsolete
attributes slot of url-object.

* url-parse.el: Improve RFC 3986 conformance.
(url-generic-parse-url): Do not populate the ATTRIBUTES slot,
since this is not reliable for general RFC 3986 URIs.  Keep the
whole path and query inside the FILENAME slot.  Improve docstring.
(url-recreate-url-attributes): Mark as obsolete.
(url-recreate-url): Handle missing scheme and userinfo.

* url-util.el (url-encode-url): New function for URL quoting.
(url-encoding-table, url-host-allowed-chars)
(url-path-allowed-chars): New constants.
(url--allowed-chars): New helper function.
(url-hexify-string): Use them.

* url-vars.el (url-nonrelative-link): Make the regexp stricter.

* url.el (url-retrieve-internal): Use url-encode-url.

Fixes: debbugs:7017
2012-05-09 16:33:48 +08:00
Chong Yidong
091006330e Allow url-http to handle expired keepalive connections.
* lisp/url/url-http.el (url-http-end-of-document-sentinel): Handle
keepalive expiry by calling url-http again.
(url-http): New arg, for the above.

Fixes: debbugs:10223
2012-03-11 23:12:26 +08:00
Devon Sean McCullough
179f69112d Bugfix for url-http-find-free-connection.
* lisp/url/url-http.el (url-http-find-free-connection): Don't pass a nil
argument to url-http-mark-connection-as-busy.

Fixes: debbugs:10891
2012-03-11 17:43:01 +08:00
Lars Ingebrigtsen
3647f557cf Fix typo in last checkin. 2012-02-10 18:30:39 +01:00
Lars Ingebrigtsen
3b8eb822d9 Cookie/redirection URL fixup
(url-http-parse-headers): When redirecting, pass on
the `inhibit-cookie' parameter.
2012-02-10 18:25:31 +01:00
Andreas Schwab
d7c5e1622f * url-http.el (url-http-clean-headers): Return the number of
removed characters.
	(url-http-wait-for-headers-change-function): Adjust end position
	after cleaning the headers.  (Bug#10768)
2012-02-10 12:36:42 +01:00
Lars Ingebrigtsen
aacaa41911 Allow specifying whether to inhibit cookies on a per-URL basis
* url-http.el (url-http-create-request): Don't send cookies unless
requested.
(url-http-parse-headers): Don't store cookies unless requested.

* url.el (url-retrieve): Ditto

* url-queue.el (url-queue-retrieve): Take an optional
`inhibit-cookies' parameter.

* url-parse.el (url): Add the `use-cookies' slot to the URL struct
to be able to keep track of whether to do cookies or not on a
per-URL basis.
2012-02-08 01:04:42 +01:00
Glenn Morris
acaf905b11 Add 2012 to FSF copyright years for Emacs files 2012-01-05 01:46:05 -08:00
Paul Eggert
fac916bfd7 Spelling fixes. 2011-12-14 13:05:20 -08:00
Paul Eggert
5396468298 Spelling fixes. 2011-11-19 01:18:31 -08:00
Paul Eggert
da6062e6ea Spelling fixes. 2011-11-14 23:55:13 -08:00
Lars Magne Ingebrigtsen
122d94635f If the server hangs up while we're talking to it, just `message' the error instead of throwing an error. 2011-11-14 17:09:13 +01:00