Results 1 to 20 of 23

Thread: CRLF in HTTP response

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: CRLF in HTTP response

    Quote Originally Posted by giusepped View Post
    Web server can use different scheme for separate header lines.
    You can have
    '\n' or '\r\n' or '\n\r'.
    Believe me beacause I tested a lot of embedded web server (not the bigger ones).
    You should report any embedded web server that uses something other "\r\n" to the creator of the server software. The HTTP RFC is clear:
    "HTTP/1.1 defines the sequence CR LF as the end-of-line marker for all protocol elements except the entity-body"
    http://www.w3.org/Protocols/rfc2616/...c2.html#sec2.2 (Was the same in HTTP/1).

    The RFC advises tolerance (http://www.w3.org/Protocols/rfc2616/...9.html#sec19.3) but even it does not mention LFCR as a possibility. You still have to accept the rubbish data from the server, but if you don't tell them they cannot fix it.

  2. #2
    Join Date
    May 2008
    Posts
    276
    Thanks
    13
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: CRLF in HTTP response

    Quote Originally Posted by ChrisW67 View Post
    You should report any embedded web server that uses something other "\r\n" to the creator of the server software. The HTTP RFC is clear:
    I agree with you. But also TCP has an RFC and there out there a lot of TCP flavors totally out of the standard (think of download accelerators).
    Anyway, what you suggest is very difficult when the producer of the embedded video server is an unknown China based maker and you have to provide your client with a solution. On the other hand, we are engineer after all, aren't we?

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: CRLF in HTTP response

    Quote Originally Posted by giusepped View Post
    I agree with you. But also TCP has an RFC and there out there a lot of TCP flavors totally out of the standard (think of download accelerators).
    Not really. There are a lot of extensions to TCP defined and they have separate RFC documents. It is true that some implementations (mostly Windows) do not conform in 100% to TCP specs but this is mostly related to unused or reserved fields.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  4. #4
    Join Date
    May 2008
    Posts
    276
    Thanks
    13
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: CRLF in HTTP response

    However, your class is of little help and I ma stucked with this problem.
    I am looking for someone can help me.
    Could you take a look at my code?
    It works for most web servers except one.
    Regards

  5. #5
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: CRLF in HTTP response

    Did you try using QHttpRequestHeader and QHttpResponseHeader as I suggested?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  6. #6
    Join Date
    May 2008
    Posts
    276
    Thanks
    13
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: CRLF in HTTP response

    Yes, it does not work.
    Regards

  7. #7
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: CRLF in HTTP response

    Could you provide a sample of http headers for which the class fails? You can provide it as an attachment to your post.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Replies: 9
    Last Post: 10th October 2012, 22:55
  2. How to parse xml from a http xml response?
    By dineshkumar in forum Qt Programming
    Replies: 3
    Last Post: 16th February 2011, 07:28
  3. Reqest and Response in XML
    By srohit24 in forum Qt Programming
    Replies: 28
    Last Post: 4th July 2009, 07:57
  4. QHTTP does not see tunneled TCP HTTP OK authentication response
    By SailingDreams in forum Qt Programming
    Replies: 6
    Last Post: 23rd May 2009, 09:39

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.