Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Mysterious LWP status 500 Line too long

by ikegami (Patriarch)
on Jul 28, 2005 at 17:42 UTC ( [id://479061]=note: print w/replies, xml ) Need Help??


in reply to Mysterious LWP status 500 Line too long

I'm not convinced making the limit bigger would help. Net::HTTP thinks a *header* line is longer than 4k. The switch shouldn't be returning a header line that big. Is it really doing that?

I think the following hack would make the limit bigger:

%OPTS = @LWP::Protocol::http::EXTRA_SOCK_OPTS; $OPTS{MaxLineLength} = ...; @LWP::Protocol::http::EXTRA_SOCK_OPTS = %OPTS;

Replies are listed 'Best First'.
Re^2: Mysterious LWP status 500 Line too long
by dpmott (Scribe) on Jul 28, 2005 at 17:55 UTC
    Hey, thanks, that works! At least, when I specify a limit of 64k.

    I took a closer look at the response from the switch. The beginning of it looks like this:

    <HTML><BODY BGCOLOR=#ffffff>
    Note that there are *no* <HEAD> tags in there. Would that be causing this problem?

    Thanks,
    -dpmott

    Update: There is no HTTP Header in the response, either. The response from the switch begins with the <HTML> tag

      The problem is with the header of the HTTP request. That's the body. An HTTP response looks like:

      HTTP/1.0 200 OK<CR><LF> Header: Value<CR><LF> Header: Value<CR><LF> Header: Value<CR><LF> <CR><LF> body

      The blank line seperates the header from the body.

      By the way, I think 0 means no limit.

        I've double-checked the TCP/IP packets coming from the switch.

        There are *no* HTTP headers. The content from the switch starts with the <HTML> tag.

        So, it looks like LWP is expecting a header that never comes, and fills up its buffer with the HTML content.

        Is there a way that I can tell LWP to *not* expect the header?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://479061]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (4)
As of 2024-04-19 13:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found