There is URI_MAX in config.h, which sets the input/output buffer size.

In the handler, you can check how much space you have for output,
int available_length = arg->out.len - arg->out.num_bytes;
Maximum space you can get is URI_MAX, if whole buffer is empty.
You cannot write more than that in one go.

You have to write stateful callback to write large output. Here's the
way you can do it:

If the reply does not fit in the buffer, write as much as possible,
and use arg->state variable to remember where to resume writing next
time. Do not set END_OF_OUTPUT.

When shttpd sends your data to the client, it will release some space
in the output
buffer, and will call the callback again. In the callback, use
arg->state variable to figure out what should you write next. When
you're done, set END_OF_OUTPUT flag.

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
shttpd-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/shttpd-general

Reply via email to