[Gambas-user] Problem with Embedded Server

Claus Dietrich claus.dietrich at freenet.de
Mon Feb 27 13:26:51 CET 2023


Dear Lee

>It is virtually impossible to know if there is a bug in your code or if the issue lies with the embedded server without seeing 
>what you are trying to do. Can you pare the project down to a small demo the illustrates the issue?

The apps are bigger ones, are programmed by Hans and will be published in the Gambas-Book soon.
He follows the rules of declaration and the compiled apps run without any issue on web servers
like Lighttpd. We would have to ask Hans to provide the apps if really needed for e review.


Dear Christof
>I'm developing a larger web application and I'm experiencing the same. 
>In my case the CGI app is called multiple times for each delivered HTML 
>page, because it contains images that have to be processed by the app too.

Thanks a lot for your confirmation. Since your app is also a bigger one it confirms our observation
that it might have to do with the scope of data to be handled. The multiple calls are normal for HTTP
but could of course play a role if there is an issue with the transfer of much data.

I found this in lighttpd.c of the component gb.httpd:
/* This global keeps track of whether we are in the main process or a
** sub-process.  The reason is that httpd_write_response() can get called
** in either context; when it is called from the main process it must use
** non-blocking I/O to avoid stalling the server, but when it is called
** from a sub-process it wants to use blocking I/O so that the whole
** response definitely gets written.  So, it checks this variable.  A bit
** of a hack but it seems to do the right thing.
*/
and are wondering, whether switching the blocking-mode is the right approach - if it has to do with it at all.

With best regards
Claus

  





More information about the User mailing list