[Gambas-user] Issues using embedded HTTP server with gb.web WebPage

T Lee Davidson t.lee.davidson at gmail.com
Wed Jun 8 03:49:03 CEST 2022


On 6/7/22 18:32, Benoit Minisini wrote:
> Le 07/06/2022 à 16:00, T Lee Davidson a écrit :
[snip]
>> But, then why does the 'Project' directory's context-sensitive menu offer the very same options as the 'Public' directory (eg. 
>> to create a New style sheet among others) if those types of files should be in 'Public' instead of '.hidden'?
> 
> The 'Project' directory contains any file you need for the development of your project, but that is not needed for running it.
> 
> Why wouldn't you need to create a style sheet file there?

I wouldn't need to create a style sheet there.

I was trying to figure out how to add a style sheet and so started right-clicking on the project's directories starting at the 
top. I brought up the context-sensitive menu for the Project' directory and saw that I could select "New > Style sheet..." So, I 
thought that is how it is supposed to be done. Thinking I had found my answer, I did not look any further at the other 
directory's context-sensitive menus.

I was simply ignorant and am now confused as to why the option to create a new style sheet is in the 'Project' directory's 
context-sensitive menu if it doesn't belong there.


>> And, do you have any idea why thttpd is behaving inconsistently? For example, I just fixed the style.css file location and 
>> executed the app to verify. It initially loaded in the browser as expected. Then I clicked the browser's reload button. The 
>> server responded correctly on the first two reloads, but on the third and subsequent reload attempts it failed to respond.
> 
> Strange, I don't remember having such a problem. Which browser do you use?

My default browser is Firefox, but I experience the issue with Chromium and Seamonkey as well.


>> I tried looking at the code, but it is a bit difficult for me to comprehend. I may have seen a connection limit or similar. 
>> Perhaps there is a security feature intended to prevent a D.O.S. attack.
>>
> 
> The embedded HTTP server is made with the source code of 'thttpd' that I modified so that it serves only one CGI request at 
> once, so that debugging is easier. Maybe this behaviour is related to your problem?

Perhaps. If the server does not realize it has finished sending the response so that it will allow another request, then, yes, 
that would be consistent with the behavior I am seeing.

Would it be possible to set a debug flag (maybe in Debug > Configuration) on the server so that requests would be printed in the 
Console? Or, simply issue a 503 Service Unavailable response?


-- 
Lee


More information about the User mailing list