tailhook / libwebsite

An HTTP and websocket protocol implementation for libev event loop (UNMAINTAINED, use rust and tk-http crate)
MIT License
39 stars 14 forks source link

Content-Length problems #6

Closed towhans closed 11 years ago

towhans commented 11 years ago

In HTTP/1.1 it says:

The field value MAY be preceded by any amount of LWS, though a single SP is preferred.

libwebsite always puts more spaces in front of the value like:

Content-Length:    9550

Which causes problems to clients that don't adhere to HTTP/1.1 specification and only accept exactly one SP. One such client is Tsung testing framework. It can only handle one SP.

This is really Tsungs issue.

tailhook commented 11 years ago

Yes, it's Tsung issue. I may consider change this if I would do rewrite the library. But for now it's too complex to change. (When the header is inserted into buffer, content length is yet unknown, so we reserve space for it and fill it later, this allows to do less memory allocations)

towhans commented 11 years ago

FYI: I reported the bug to Tsung and they fixed it: https://support.process-one.net/browse/TSUN-238?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel

So it is now possible to benchmark zerogw by Tsung.

tailhook commented 11 years ago

Great news. Thanks!