unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Glenn Morris <rgm@gnu.org>
To: Blazej Adamczyk <blazej.adamczyk@gmail.com>
Cc: 13598@debbugs.gnu.org
Subject: bug#13598: 24.3.50
Date: Thu, 27 Feb 2014 17:43:08 -0500	[thread overview]
Message-ID: <cqvbw0kwhv.fsf@fencepost.gnu.org> (raw)
In-Reply-To: <2DC22385-AACB-4B7D-9918-3EB835B8526C@gmail.com> (Blazej Adamczyk's message of "Wed, 26 Feb 2014 17:54:06 +0100")

Blazej Adamczyk wrote:

> By example:
> When parsing response we may get in state when we will receive only
> the following:
>
> "HTTP/1.0 200 OK^M
> "
>
> without double quotes (I added them to show the newline character).
>
> In case of current implementation the regexp "^\r?$" and the previous
> regexp "^\r*$" both are matching the end of string. That is wrong
> because there will be something in the new line after a while.

The current implementation uses "^\r?\n", not "^\r?$".
Where did you get "^\r?$" from?

As such I do not see that it will match your example.

> RFC 2616 states clear:
>        generic-message = start-line
>                          *(message-header CRLF)
>                          CRLF
>                          [ message-body ]
>        start-line      = Request-Line | Status-Line
>
> there has to be one (exactly one) CR in a single line between headers
> and body. Thus I propose a simple regexp "^\r$".

Yes, but as I already quoted in

http://debbugs.gnu.org/13598#17

it also recommends tolerance:

   The line terminator for message-header fields is the sequence CRLF.
   However, we recommend that applications, when parsing such headers,
   recognize a single LF as a line terminator and ignore the leading CR.





  reply	other threads:[~2014-02-27 22:43 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-31 17:26 bug#13598: 24.3.50; url-http.el doesn't correctly parse headers when they are sent line-by-line Jonas Hoersch
2013-02-07 18:13 ` Jonas Hörsch
2013-02-13 17:19   ` Bastien
2013-02-13 19:30     ` Stefan Monnier
2013-02-13 19:42     ` Glenn Morris
2013-02-13 21:38       ` Glenn Morris
2013-02-14  6:08         ` Bastien
2013-02-16  2:06         ` Glenn Morris
2014-02-26  9:32 ` bug#13598: 24.3.50; Blazej Adamczyk
2014-02-26 16:54 ` bug#13598: 24.3.50 Blazej Adamczyk
2014-02-27 22:43   ` Glenn Morris [this message]
2014-03-03  6:10     ` Blazej Adamczyk

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=cqvbw0kwhv.fsf@fencepost.gnu.org \
    --to=rgm@gnu.org \
    --cc=13598@debbugs.gnu.org \
    --cc=blazej.adamczyk@gmail.com \
    /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).