We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x

Mongoose Web Server, how do disable output buffer

Medium Priority
861 Views
Last Modified: 2016-02-10
The Mongoose webserver will buffer the output.  Once the buffer is filled then it will output the content, so it is as if the HTML hangs in the middle of rendering.

Is there a way to disable the buffer (or turn on  autoflush)
Comment
Watch Question

Top Expert 2015

Commented:
Do you mean setsockopt(sock,TCP_NODELAY) ?

Author

Commented:
I mean when I launch mongoose, is there an option to flush out the buffer.
For example:
/usr/local/bin/mongoose -ssl_cert /var/www/conf/server.pem -ports 443s -root /var/www/html -dir_list no -access_log /var/log/httpd_access -error_log /var/log/httpd_error
Top Expert 2015

Commented:
There is no command line option to do that. You have to change the code and recompile.
Does it have to do at all with apache?
If your operating system supports you can disable NAGLE's aka enable NODELAY.

Author

Commented:
Would you happen to know where it is on FreeBSD?
Top Expert 2015

Commented:
PS it's socket IO code is far from optimal, it is not a setsockopt one-liner to fix it.
PPS use thttpd,nginx or something else well established on the scene.
Top Expert 2015

Commented:
On FreeBSD you have to recompile, and rewrite worker_thread function to set socket options before sending output to them.
If you do not program, it is a no-go.
Top Expert 2015
Commented:
Unlock this solution with a free trial preview.
(No credit card required)
Get Preview

Author

Commented:
Thanks for the prompt response.
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a free trial preview!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.