|
From: | bignm |
Subject: | [bug-cgicc] FIXED: Form fields not parsed with encoding multipart/form-data encoding |
Date: | Sat, 23 Jun 2012 15:15:17 -0700 |
Dear mailing list: After debugging the source code of GNU cgicc version 3.2 to determine why form fields were not being parsed when an HTML INPUT type=file was present, the problem was finally traced down to the following code (fixed code displayed below): In file Cgicc.cpp ... CGICCNS MultipartHeader // This is hairy: Netscape and IE don't encode the filenames The fix was the addition of the "if (data.find("filename=") != ... wraparound code since the check in the routine parseMIME() was getting crud data in the head.getFilename() comparison. Now form fields are being processed properly when an HTML form uses the multipart/form-data encoding type. As a side note, when the option --enable-debug-logging is supplied to configure the sources contrib/nph-login.cpp and contrib/nph-hello.cpp do not compile because the DEBUG logic is missing the STDNS qualifier. The fixed code is below (which also removes the non-existing path in front of the cgicc.log filename) so now the log file appears in the current working directory. // To use the debug logging feature, the variable gLogFile MUST be The fixed Cgicc.cpp & nph-hello.cpp & nph-login.cpp source files are attached. Regards, Tom Straub |
Cgicc.cpp
Description: Binary data
nph-hello.cpp
Description: Binary data
nph-login.cpp
Description: Binary data
[Prev in Thread] | Current Thread | [Next in Thread] |