ufairiya / mongoose

Automatically exported from code.google.com/p/mongoose
MIT License
0 stars 0 forks source link

directory listing blocks forever when Keep-Alive is enabled #185

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Start mongoose server with keep_alive, a document_root containing some files 
and no "index.html"
2. Open Firefox and point it to the mongoose server

What is the expected output? What do you see instead?
Firefox should display the directory listing, but keeps loading the "index of 
/" forever instead.

What version of the product are you using? On what operating system?
Mongoose 2.11 - Linux

Please provide any additional information below.

The function handle_directory_request sets "Connection: close" and does not 
define a "Content-Length: " header, but since Keep-Alive is enabled, the socket 
is not closed by mongoose.
The result is that the response does not contain the necessary information to 
detect where it finishes.

The attached patch contains a simple solution: set a flag in the connection to 
force the socket to be closed even if keep-alive is enabled.

Original issue reported on code.google.com by rodrigo...@gmail.com on 8 Oct 2010 at 5:50

Attachments:

GoogleCodeExporter commented 9 years ago
This issue is related to issue 319 - the fix for 319 should also fix this one.

Original comment by bel2...@gmail.com on 30 Mar 2012 at 7:29

GoogleCodeExporter commented 9 years ago
Directory listing is now closes the connection.
Fixed.

Original comment by valenok on 23 Sep 2012 at 1:07