Hi Tommi
3 issues:
- uploading large files fails using Linux clients only
- socket failed error messages on one server
- upload iterator it != mp.end() true when should be false
Scenario:
I started trying to upload files to a tntnet application we are
developing and everything works fine on our testing server. But when we
installed on the production server everything worked except large file
(100K+) uploads (not that this is very large!). The testing server
permitted 1M+ easily. We are aware of the MaxRequestSize setting and we
have set this to zero (no limit) as well as other limits. Basically the
connection is killed with large uploads even if they are well below the
limit (or if there is no limit) and sometimes it requires a restart of
tntnet in order to upload even small files thereafter (puts tntnet in a
bad state, but only for uploads, otherwise the application operates
normally).
It gets stranger:
The upload problem *only* occurs when using Linux (Firefox and Epiphany
both tested and failed). Using Windows Firefox and IE can easily upload
1M+ files, never fails. But a browser running on Linux always fails with
large files (but not with files under approx 30k).
We noticed the tntnet log on the production server is generating many
"socket failed" errors. This is new. Previously we had no such errors.
These errors occur even without uploading files. Maybe this is related.
It comes from worker.cpp
Again, no problem on our testing server (no socket errors and no problem
with file uploads) and it is only Linux browser clients accessing the
production server that have the problem.
Running tntnet 1.5.3-2 on Debian Etch, Kernel 2.6.18-5
Code being used to write file (simplified): Also note, which I found
strange, it != mp.end() was true even if I was not uploading a file. So
I had to add the if ( it->getFilename() != "" ) as a work around.
const tnt::Multipart& mp = pclRequest.getMultipart();
tnt::Multipart::const_iterator it = mp.find( "pflUpload" );
if (it != mp.end())
{
if ( it->getFilename() != "" )
{
std::ofstream f(vtxFolderAndFile.c_str());
std::copy(it->getBodyBegin(), it->getBodyEnd(),
std::ostreambuf_iterator<char>(f));
}
}
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Tntnet-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tntnet-general