Hacky HTTP 1.1 persistent connection model for the sync server

The code it's absolutely hacky, and it's intended only as a prototype

The intention is port sync server to the HTTP 1.1 persistent connection model, with pipeling support

As I repeat myself, the code is hacky -- the result of a full day of work on it

request_builder keep the state of each single request, and assign a status per request:
NEED_MORE_DATA <-The current request is incomplete
COMPLETE <-Complete, probably a bad name -- is the last request (is not an HTTP 1.1 request, or content-length is not present, or if Connection: close is present)
WAIT_FOR_ANOTHER_REQUEST <-The current request is now complete and is not COMPLETE, client can issue a new one
BAD_REQUEST <-Classic bad request

sync_connection keeps a list of request (the idea is not going to deallocate old request buffer while we are going to process the next)

sync_request know the status of each request, and can keep goig if the request is not the last one/bad reqeust

I did change the response header for 200 so the client can know that we are a HTTP 1.1 server

The timeout is hardcoded in the code (15 seconds) and is reset each time that a sync_request get data from the client
If a request timeout, handle_close is called

As you can view, the code is not so great (a full day of hacking)...so I accept all kinds of advice

I'm not sure if there are some memory leak of not...

So in the end:
It implement HTTP 1.1 connection model
sync_timeout has a timeout so after a while that the connection has not sent data, the connection is closed
Only 200 response is HTTP 1.1
request_builder keeps sync_connection alive only if a HTTP 1.1 request, there is a length, and is not connection close
sync_connection keep a list of executed request

Problems:
Naming!
The timeout is hardcoded
Now the server reply with HTTP 1.1 all the times...
There is a possibility to DoS the server -- it keeps all the executed request
There is a possibility of a memory leak...I can't tell

So question time:
How netlib should manage both HTTP 1.0 and 1.1?
Is necessary to keep the list of executed requests? Even if we consider pipelining?
What are the others case where in HTTP 1.1 netlib should not keep the socket open?
How we make the timeout configurable?
Testing? How?
There are some memory leak?

Some things that I didn't considered?