unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#14372: 24.3; url package http end of headers false positive
@ 2013-05-08 21:15 Ben Anhalt
  2013-05-08 23:08 ` Glenn Morris
  0 siblings, 1 reply; 3+ messages in thread
From: Ben Anhalt @ 2013-05-08 21:15 UTC (permalink / raw)
  To: 14372

In url-http.el in url-http-wait-for-headers-change-function the regular
expression for detecting the end of HTTP headers is "^\r*$" which can
result in false positives if a partial response (with more headers to
come) is received that ends in a newline. That is, "HTTP/1.1 200
OK\r\nSome-header: foo\r\n" matches at the end as an empty line even
though there is no way to tell if more headers will arrive.

It needs to detect a line that contains nothing but "\r", so a RE like
"^\r+$" or simply "^\r$" would be more appropriate.

In GNU Emacs 24.3.1 (x86_64-pc-linux-gnu, GTK+ Version 3.4.2)
 of 2013-04-14 on chindi10, modified by Debian
Windowing system distributor `The X.Org Foundation', version 11.0.11103000
System Description:	Ubuntu 12.04.2 LTS

Configured using:
 `configure '--build' 'x86_64-linux-gnu' '--build' 'x86_64-linux-gnu'
 '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib'
 '--localstatedir=/var/lib' '--infodir=/usr/share/info'
 '--mandir=/usr/share/man' '--with-pop=yes'
 '--enable-locallisppath=/etc/emacs24:/etc/emacs:/usr/local/share/emacs/24.3/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/24.3/site-lisp:/usr/share/emacs/site-lisp'
 '--with-crt-dir=/usr/lib/x86_64-linux-gnu' '--with-x=yes'
 '--with-x-toolkit=gtk3' '--with-toolkit-scroll-bars'
 'build_alias=x86_64-linux-gnu' 'CFLAGS=-g -O2 -fstack-protector
 --param=ssp-buffer-size=4 -Wformat -Wformat-security
 -Werror=format-security -Wall' 'LDFLAGS=-Wl,-Bsymbolic-functions
 -Wl,-z,relro' 'CPPFLAGS=-D_FORTIFY_SOURCE=2''

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix
  default enable-multibyte-characters: t

Major mode: Emacs-Lisp

Minor modes in effect:
  shell-dirtrack-mode: t
  elisp-slime-nav-mode: t
  eldoc-mode: t
  global-undo-tree-mode: t
  undo-tree-mode: t
  global-rainbow-delimiters-mode: t
  rainbow-delimiters-mode: t
  which-function-mode: t
  show-paren-mode: t
  winner-mode: t
  global-auto-revert-mode: t
  my-keys-minor-mode: t
  ido-everywhere: t
  tooltip-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  buffer-read-only: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
<return> y M-x r e v e r <tab> t <tab> <return> y C-x 
k <return> C-x C-f . a u <return> C-x k <return> C-x 
k <return> C-x o C-x 0 M-x r e p <tab> o r <tab> <
return>

Recent messages:
465
Sending...
Save auth info to file ~/.authinfo? [y/n/N/e/?] y
Saved new authentication information to ~/.authinfo
Sending email 
Sending email done
Sending...done
Making completion list...
Revert buffer from file /home/ben/.emacs.d/custom.el? (y or n)  y
Making completion list...

Load-path shadows:
/home/ben/.emacs.d/elpa/markdown-mode-20130328.918/markdown-mode hides /usr/share/emacs24/site-lisp/emacs-goodies-el/markdown-mode
/usr/share/emacs/24.3/site-lisp/debian-startup hides /usr/share/emacs/site-lisp/debian-startup
/home/ben/.emacs.d/custom hides /usr/share/emacs/24.3/lisp/custom
/usr/share/emacs24/site-lisp/dictionaries-common/flyspell hides /usr/share/emacs/24.3/lisp/textmodes/flyspell
/usr/share/emacs24/site-lisp/dictionaries-common/ispell hides /usr/share/emacs/24.3/lisp/textmodes/ispell
/home/ben/.emacs.d/elpa/magit-20130502.1609/.dir-locals hides /usr/share/emacs/24.3/lisp/gnus/.dir-locals

Features:
(rfc2104 rmail mail-hist mailalias epa-mail epa derived epg epg-config
apropos dired tramp-cache tramp tramp-compat tramp-loaddefs gnutls
smtpmail cus-edit cus-start cus-load wid-edit shadow sort mail-extr
emacsbug message rfc822 mml mml-sec mm-decode mm-bodies mm-encode
mailabbrev gmm-utils mailheader sendmail python-mode info-look info
compile visual-regexp pcase hippie-exp edebug pp thingatpt misearch
multi-isearch jka-compr mail-utils timezone parse-time pcmpl-unix shell
debug ace-jump-mode network-stream starttls url-cache url-http tls
mail-parse rfc2231 rfc2047 rfc2045 ietf-drums url-gw url-auth specify
json url url-proxy url-privacy url-expand url-methods url-history
url-cookie url-domsuf url-util url-parse auth-source eieio gnus-util
mm-util mail-prsvr password-cache url-vars mailcap add-log vc-git
elisp-slime-nav help-mode etags eldoc zenburn-theme server undo-tree
diff rainbow-delimiters which-func imenu paren winner autorevert
ob-python org byte-opt warnings bytecomp byte-compile cconv ob-tangle
ob-ref ob-lob ob-table org-footnote org-src ob-comint ob-keys
org-pcomplete pcomplete comint ansi-color ring org-list org-faces
org-entities noutline outline org-version ob-emacs-lisp ob org-compat
org-macs ob-eval org-loaddefs format-spec find-func cal-menu easymenu
calendar cal-loaddefs uniquify advice help-fns advice-preload
key-bindings edmacro kmacro setup-package ace-jump-mode-autoloads
coffee-mode-autoloads elisp-slime-nav-autoloads expand-region-autoloads
fill-column-indicator-autoloads flymake-cursor-autoloads
js2-mode-autoloads jump-char-autoloads lua-mode-autoloads
magit-autoloads mark-multiple-autoloads markdown-mode-autoloads
php-mode-autoloads rainbow-delimiters-autoloads restclient-autoloads
slime-autoloads undo-tree-autoloads visual-regexp-autoloads finder-inf
zenburn-theme-autoloads package setup-hippie ido cl-macs gv cl cl-lib
emacs-goodies-el emacs-goodies-custom emacs-goodies-loaddefs easy-mmode
time-date tooltip ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd
tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment
lisp-mode register page menu-bar rfn-eshadow timer select scroll-bar
mouse jit-lock font-lock syntax facemenu font-core frame cham georgian
utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean
japanese hebrew greek romanian slovak czech european ethiopic indian
cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev
minibuffer loaddefs button faces cus-face macroexp files text-properties
overlay sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote make-network-process dbusbind
dynamic-setting system-font-setting font-render-setting move-toolbar gtk
x-toolkit x multi-tty emacs)





^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#14372: 24.3; url package http end of headers false positive
  2013-05-08 21:15 bug#14372: 24.3; url package http end of headers false positive Ben Anhalt
@ 2013-05-08 23:08 ` Glenn Morris
  2013-05-08 23:13   ` Ben Anhalt
  0 siblings, 1 reply; 3+ messages in thread
From: Glenn Morris @ 2013-05-08 23:08 UTC (permalink / raw)
  To: Ben Anhalt; +Cc: 14372

Ben Anhalt wrote:

> In url-http.el in url-http-wait-for-headers-change-function the regular
> expression for detecting the end of HTTP headers is "^\r*$" which can
> result in false positives if a partial response (with more headers to
> come) is received that ends in a newline. That is, "HTTP/1.1 200
> OK\r\nSome-header: foo\r\n" matches at the end as an empty line even
> though there is no way to tell if more headers will arrive.
>
> It needs to detect a line that contains nothing but "\r", so a RE like
> "^\r+$" or simply "^\r$" would be more appropriate.

Thanks for the report. I believe this is already fixed in Emacs trunk:

http://debbugs.gnu.org/cgi/bugreport.cgi?bug=13598

> In GNU Emacs 24.3.1 (x86_64-pc-linux-gnu, GTK+ Version 3.4.2)
>  of 2013-04-14 on chindi10, modified by Debian





^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#14372: 24.3; url package http end of headers false positive
  2013-05-08 23:08 ` Glenn Morris
@ 2013-05-08 23:13   ` Ben Anhalt
  0 siblings, 0 replies; 3+ messages in thread
From: Ben Anhalt @ 2013-05-08 23:13 UTC (permalink / raw)
  To: Glenn Morris; +Cc: 14372

[-- Attachment #1: Type: text/plain, Size: 1062 bytes --]

Yes, it is the same bug. I did not see that one when searching. Thank you
for the reply.

Ben


On Wed, May 8, 2013 at 6:08 PM, Glenn Morris <rgm@gnu.org> wrote:

> Ben Anhalt wrote:
>
> > In url-http.el in url-http-wait-for-headers-change-function the regular
> > expression for detecting the end of HTTP headers is "^\r*$" which can
> > result in false positives if a partial response (with more headers to
> > come) is received that ends in a newline. That is, "HTTP/1.1 200
> > OK\r\nSome-header: foo\r\n" matches at the end as an empty line even
> > though there is no way to tell if more headers will arrive.
> >
> > It needs to detect a line that contains nothing but "\r", so a RE like
> > "^\r+$" or simply "^\r$" would be more appropriate.
>
> Thanks for the report. I believe this is already fixed in Emacs trunk:
>
> http://debbugs.gnu.org/cgi/bugreport.cgi?bug=13598
>
> > In GNU Emacs 24.3.1 (x86_64-pc-linux-gnu, GTK+ Version 3.4.2)
> >  of 2013-04-14 on chindi10, modified by Debian
>



-- 
Ben Anhalt
ben.anhalt@gmail.com
Mi parolas Esperante.

[-- Attachment #2: Type: text/html, Size: 1683 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-05-08 23:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-08 21:15 bug#14372: 24.3; url package http end of headers false positive Ben Anhalt
2013-05-08 23:08 ` Glenn Morris
2013-05-08 23:13   ` Ben Anhalt

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).