chesterpolo / mongoose

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

access log show 0 return code and 0 size for some responses #213

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I'm using mongoose 2.8 but from the code it looks like this applies to the 
latest version as well.

For all requests that mongoose handles itself, the access log shows correct 
return code and response length values. Any request that is handled via 
callback is barred from setting conn->num_bytes_sent and so cannot have an 
accurate access log entry.  Callback code can set request_info.status_code but 
it is not obvious that this would need to be done.

It would be nice if the access log worked transparently for all responses.

More info:

There are several places in mongoose.c like this:

    conn->num_bytes_sent += mg_printf( ...

Why not have mg_printf() and mg_write() update num_bytes_sent internally so it 
works for both mongoose internals and callback code?

Original issue reported on code.google.com by streambr...@gmail.com on 17 Dec 2010 at 8:06