Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
If I run
nc -l 9903
And then run LWP and paste something like this into "nc" window
HTTP/1.1 200 OK Content-Length: 133 LNJKjadfkj ^C
I will get in 'lwp' window:
GET -S -e http://localhost:9903/ GET http://localhost:9903/ --> 200 OK Content-Length: 133 Client-Date: Thu, 30 May 2013 06:41:09 GMT Client-Peer: 127.0.0.1:9903 Client-Response-Num: 1 LNJKjadfkj
So it's detected as success request. But tools like curl/wget report this as error/warning or even retry.
And according to RFC http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.4 Content-Length is priority over connecion close.
When a message-body is included with a message, the transfer-length of that body is determined by one of the following (in order of precedence):
...
3. If a Content-Length header field (section 14.13) is present, its decimal value in OCTETs represents both the entity-length and the transfer-length
...
5.By the server closing the connection.
Am I missing something?
UPD
So, not sure if this intended behaviour or no, so I reported a bug https://rt.cpan.org/Public/Bug/Display.html?id=85759

In reply to Should LWP warn about wrong Content-Length? by vsespb

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (9)
As of 2024-04-18 08:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found