Closed GoogleCodeExporter closed 9 years ago
There is another more correct fix: uncomment line 1587 in mongoose.c
Windows by default handles correctly files like "C:\Web/file.html", but this
breaks the strrchr used in do_ssi_include to get the directory from the
current SSI file.
Attached is a MingW-compiled mongoose "3.1.1" for Win32 with this bug fixed.
Original comment by socram8...@gmail.com
on 15 Mar 2012 at 11:06
Attachments:
Did you mean line 1588, function convert_uri_to_file_name of Version
09127fc647dd?
//change_slashes_to_backslashes(buf);
Thank you, but I cannot use a prebuild executable since I need some more
changes. However commenting out this line seems to solve the SSI issue.
However, I wonder why it was commented out and what side effects this line may
have.
If it does not have side effects, it would of course be a nicer fix.
Original comment by bel2...@gmail.com
on 15 Mar 2012 at 12:11
This patch also changes the way the cgi interpreter ist called (the arguments
of CreateProcessA). So the side effect is that cgi scripts in subdirectories do
not work anymore for windows.
I changed the Trace in spawn_process to
DEBUG_TRACE(("Running [%s] in [%s]", cmdline, dir));
1) With the line commented out I get
Running [Interpreter .\./Path/Script.cgi] in [.]
2) With the line active
Running [Interpreter .\Path\Script.cgi] in [.\Path]
the leading . is my content root (line "r ." in the .conf file)
For 2) the path to the cgi script is duplicated;
so, the cgi interpreter searches for .\Path\Path\Script.cgi
To fix this, the path should not be added to the cmdline:
(void) mg_snprintf(conn, cmdline, sizeof(cmdline), "%s%s%s",
interp, interp[0] == '\0' ? "" : " ", prog);
With these changes it works:
Running [Interpreter Script.cgi] in [.\Path]
I think this would fix the SSI relative include issue and unify the cgi working
path for windows and linux.
Original comment by bel2...@gmail.com
on 15 Mar 2012 at 3:39
I've made suggested changes recently, and the aforementioned unification.
SSI works as intended. Minor remark: file=".." is considered by mongoose as
relative to document root.
Paths relative to the current document should be specified as <!--#include
"file.ext" -->
Original comment by valenok
on 23 Sep 2012 at 12:55
Original issue reported on code.google.com by
bel2...@gmail.com
on 14 Mar 2012 at 10:08