unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Blazej Adamczyk <blazej.adamczyk@gmail.com>
To: Glenn Morris <rgm@gnu.org>
Cc: 13598@debbugs.gnu.org
Subject: bug#13598: 24.3.50
Date: Mon, 3 Mar 2014 07:10:21 +0100	[thread overview]
Message-ID: <481D100B-FD57-41C1-9F26-83EFB1C0CF25@gmail.com> (raw)
In-Reply-To: <cqvbw0kwhv.fsf@fencepost.gnu.org>

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

Ahh yes my mistake! I was looking at some wrong sources. Obviously the current "^\r?\n" is correct. 

Sorry and thanks!
Blazej

From Glenn Morris <rgm@gnu.org> w dniu 27 lut 2014, o godz. 23:43:

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.


[-- Attachment #2: Message signed with OpenPGP using GPGMail --]
[-- Type: application/pgp-signature, Size: 495 bytes --]

      reply	other threads:[~2014-03-03  6:10 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
2014-03-03  6:10     ` Blazej Adamczyk [this message]

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=481D100B-FD57-41C1-9F26-83EFB1C0CF25@gmail.com \
    --to=blazej.adamczyk@gmail.com \
    --cc=13598@debbugs.gnu.org \
    --cc=rgm@gnu.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).