Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Problem with qx/system and long urls

by Thelonius (Curate)
on Apr 24, 2007 at 15:28 UTC ( #611761=note: print w/ replies, xml ) Need Help??


in reply to Problem with qx/system and long urls

My educated guess:

Windows CMD.EXE has a limit on the total # of bytes for environment variables and the names of the variables: 32,767. Your URL has 16K bytes, and it's put in the environment more than once (request_uri, path, query_string). So the process can't be created with that big an environment.

Solution: use HTTP POST method instead of GET.

Although the IETF standards don't specify a maximum length for URLs, RFC2616 does say "Note: Servers ought to be cautious about depending on URI lengths above 255 bytes, because some older client or proxy implementations might not properly support these lengths."

FYI: Microsoft IE and IIS limit URLs to about 2K.


Comment on Re: Problem with qx/system and long urls
Re^2: Problem with qx/system and long urls
by bluelu (Initiate) on Apr 24, 2007 at 15:41 UTC
    Thanks for your answer! I used GET because I wanted to have bookmarkable urls, so I could rerun the simulation again and again, or even send the link to another person who could then run the simulation on his computer, by simply clicking the link. So I guess I have to find a workaround for this. By using HTTP POST, I'm not able to bookmark the urls anymore. Does the linux shell (bash) has the same limit, or can environment variables be undefinitely big? I could start the server in cygwin or even vmware with linux then.
      Could you collect the data that is in the post into a database row and give people that row id as a token in a single query string param?

      Phil

      The Gantry Web Framework Book is now available.
        That would be a possibility. I intented however to start the server localy on each server.
        But I will probably move to a centralised approach after all.
      { local %ENV = map { $_ => "$ENV{$_}" } qw{ ALLUSERSPROFILE APPDATA COMMONPROGRAMFILES COMPUTERNAME COMSPEC FB_FILE HOMEDRIVE HOMEPATH LOGONSERVER OS PATH PATHEXT PROGRAMFILES PROMPT SESSIONNAME SYSTEMDRIVE SYSTEMROOT TEMP USERDOMAIN USERNAME USERPROFILE WINDIR }; print qx{ dir }; }
        ++. That's exactly what I needed :-)

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (6)
As of 2014-09-16 03:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite cookbook is:










    Results (155 votes), past polls