Hello Marco,
Am Sonntag 14 September 2008 21:41:42 schrieb Marco:
> Hello,
>
>
> this time I try to set up my first small web project with tntnet web
> server. On my point of view there are two big issues:
>
> 1. When I stream a very large file from harddisk to the reply object, this
> is very slow and consumes masses of memory because the whole file seems to
> be cached. By now I have an apache running on another port to send large
> files to the client. But this is not a very good solution.
> Is there a way to send very large files effciently like apache does?
>
The reason, why tntnet acts this way is, that the user application may throw
an exception or otherwise stop sending data keeping a open http-transaction.
And also tntnet needs to send a content-size-header prior to the body. This
can done only, when the complete body is known.
Still there is a direct mode, which can be enabled with reply.setDirectMode(),
which connects the reply.out() to the socket. But you need to fill in the
content-size header first and be very careful not to break http.
Luckily there is a standard module called [EMAIL PROTECTED] in tntnet, which
sends
static pages very efficiently. If you add e.g.
MapUrl /(.*.html) [EMAIL PROTECTED] /var/www/$1
you define a static webserver for html-pages.
Or you define
DocumentRoot /var/www
MapUrl .* [EMAIL PROTECTED]
which maps every url to the file in document root.
Tntnet takes also care not to break the document root with double dot attacks.
Unfortunately the standard components lack documentation. I need to write at
least some man pages for them.
> 2. When I create multi-image-components, and add corresponding info to
> MapUrl everything works fine. But what's the best way protecting this
> images via HTTP-
>
I don't quite understand your problem. Can you please explain, what do you
want to protect.
Tommi
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Tntnet-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tntnet-general