windbreakerdoss / phpdesktop

Automatically exported from code.google.com/p/phpdesktop
0 stars 0 forks source link

Problems when CGI environment variables exceed 4KB in size #128

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
If for example PATH environment variable is about 4KB, then Mongoose web server 
will skip adding any further env variables to CGI environment. This includes 
HTTP_ env variables (build from http headers) and phpdesktop env variables 
(temp dir, phpdesktop version etc). The solution is to increase the 
CGI_ENVIRONMENT_SIZE constant in Mongoose web server.

Issue reported on Forum:
https://groups.google.com/d/topic/phpdesktop/HaP5Igv4ebU/discussion

Original issue reported on code.google.com by czarek.t...@gmail.com on 8 Oct 2014 at 9:26

GoogleCodeExporter commented 9 years ago
Error messages in debug.log file look like this:

    - 09:31:35.797 WARNING: vsnprintf error
    - 09:31:35.797 WARNING: addenv: CGI env buffer truncated for [HTTP_%s=%s]
    - 09:31:35.797 WARNING: vsnprintf error
    - 09:31:35.797 WARNING: addenv: CGI env buffer truncated for [HTTP_%s=%s]
    - 09:31:35.813 WARNING: vsnprintf error
    - 09:31:35.813 WARNING: addenv: CGI env buffer truncated for [%.*s]
    - 09:31:35.813 WARNING: vsnprintf error
    - 09:31:35.813 WARNING: addenv: CGI env buffer truncated for [%.*s]
    - 09:31:35.813 WARNING: vsnprintf error
    - 09:31:35.813 WARNING: addenv: CGI env buffer truncated for [%.*s]
    - 09:31:35.813 WARNING: vsnprintf error
    - 09:31:35.813 WARNING: addenv: CGI env buffer truncated for [%.*s]
    - 09:31:35.813 WARNING: vsnprintf error
    - 09:31:35.813 WARNING: addenv: CGI env buffer truncated for [%.*s]

Original comment by czarek.t...@gmail.com on 8 Oct 2014 at 9:34

GoogleCodeExporter commented 9 years ago
Fixed in revision 615b7caecf84. Limit is now set to 64KB. Also exceeded number 
of env variables to 512.

Original comment by czarek.t...@gmail.com on 8 Oct 2014 at 9:38