| 32 | |
| 33 | |
| 34 | HTTPServerRequestImpl::HTTPServerRequestImpl(HTTPServerResponseImpl& response, HTTPServerSession& session, HTTPServerParams* pParams): |
| 35 | _response(response), |
| 36 | _session(session), |
| 37 | _pStream(0), |
| 38 | _pParams(pParams, true) |
| 39 | { |
| 40 | response.attachRequest(this); |
| 41 | |
| 42 | HTTPHeaderInputStream hs(session); |
| 43 | read(hs); |
| 44 | |
| 45 | // Now that we know socket is still connected, obtain addresses |
| 46 | _clientAddress = session.clientAddress(); |
| 47 | _serverAddress = session.serverAddress(); |
| 48 | |
| 49 | if (getChunkedTransferEncoding()) |
| 50 | _pStream = new HTTPChunkedInputStream(session); |
| 51 | else if (hasContentLength()) |
| 52 | _pStream = new HTTPFixedLengthInputStream(session, getContentLength64()); |
| 53 | else if (getMethod() == HTTPRequest::HTTP_GET || getMethod() == HTTPRequest::HTTP_HEAD || getMethod() == HTTPRequest::HTTP_DELETE) |
| 54 | _pStream = new HTTPFixedLengthInputStream(session, 0); |
| 55 | else |
| 56 | _pStream = new HTTPInputStream(session); |
| 57 | } |
| 58 | |
| 59 | |
| 60 | HTTPServerRequestImpl::~HTTPServerRequestImpl() |
nothing calls this directly
no test coverage detected