Inheritance diagram for Protocols::Http::Testing::DataSerializerTest:


Thoughts: NO Transfer-Encoding: header -> IdentityCodec Transfer-Encoding; chunked -> ChunkCodec Transfer-Encoding: deflate -> DeflateCodec Transfer-Encoding: deflate chunked -> CodecChain: ChunkCodec | DeflateCodec
if Transfer-Encoding: is not identity??/not specified => Content-Length: MUST be ignored setup decoding chain else if Content-Length is specified => content-length == transfer-length == entity-length use a single IdentityCodec (content-length) else use a single IdentityCodec (-1)?? i.e. read all available
2.If a Transfer-Encoding header field (section 14.41) is present and has any value other than "identity", then the transfer-length is defined by use of the "chunked" transfer-coding (section 3.6), unless the message is terminated by closing the connection.
multipart messages => use MultipartCodec???
In general, HTTP treats a multipart message-body no differently than any other media type: strictly as payload. The one exception is the "multipart/byteranges" type (appendix 19.2) when it appears in a 206 (Partial Content) response, which will be interpreted by some HTTP caching mechanisms as described in sections 13.5.4 and 14.16. In all other cases, an HTTP user agent SHOULD follow the same or similar behavior as a MIME user agent would upon receipt of a multipart type.
HttpClientSession ?? Content-Type: multipart/byteranges HttpClientSession ?? Content-Range:
NO Content-Length: and HTTP/1.1 => a. require Transfer-Encoding: chunked ... b. Connection: close => c. Connection: keep-alive or HTTP/1.1 => ii.
Definition at line 73 of file DataSerializerTest.cpp.
Public Member Functions | |
| void | setUp () |
| void | tearDown () |
| void | refReadHeaderFails () |
| Reading fails if a complete header cannot be read from transport. | |
| void | refReadHeaderOK (const Header &header) |
| Read a complete header from transport and create readCodec. | |
| void | refReadLfTerminatedHeaderOK (const Header &header) |
| Read a complete <LF><LF> terminated header. | |
| void | refReadBodyChunk (const Data &chunk) |
| A body chunk is read from transport through readCodec. | |
| void | refReadBodyChunkFails () |
| The codec cannot read enought data from transport. | |
| void | refReadBodyEnd () |
| Reading BodyEnd indicates the end of the body and readCodec is freed. | |
| void | stateReadingHeader () |
| void | stateReadingBody (const Header &header) |
| void | postStateReadingHeader () |
| void | postStateReadingBody () |
| void | scenarioReadHeaderFails () |
| We cannot read a header from transport now but we can retry later. | |
| void | scenarioReadHeaderOK (const Header &header, bool lfTerminated=false) |
| After header is successfully read, we can go on and read the body. | |
| void | scenarioReadBody (const Header &header, const QList< Data > &bodyChunks) |
| Read a body consisting of a number of chunks followed by BodyEnd(). | |
| void | testReadHeaderFails () |
| void | testReadHeader () |
| void | testReadHeaderLfLfTerminated () |
| void | testReadBodyOfOneChunk () |
| void | testReadTwoMessages () |
| void | testReadMessageWithInterrupts () |
| void | refWriteHeaderSucceeds (const Header &header) |
| After header is written, a writeCodec for the body is created. | |
| void | refWriteHeaderFails (const Header &header) |
| Writing header fails, no writeCodec for the body is created. | |
| void | refWriteBodyChunk (const Data &chunk, bool willSucceed) |
| A body chunk is written to transport through writeCodec. | |
| void | stateWritingHeader () |
| void | stateWritingBody (const Header &header) |
| void | postStateWritingHeader () |
| void | postStateWritingBody () |
| void | scenarioWriteHeaderFails (const Header &header) |
| Writing header to serializer fails. | |
| void | scenarioWriteHeaderOK (const Header &header) |
| Write header to serializer. | |
| void | scenarioWriteBody (const Header &header, const QList< Data > &chunks) |
| Write a number of body chunks after a header has already been written. | |
| void | testWriteHeaderFails () |
| void | testWriteHeaderOK () |
| void | testWriteBodyOfOneChunk () |
| void | testWriteBodyOfMultipleChunksWithDelays () |
| void | writeTwoMessages () |
Private Member Functions | |
| CPPUNIT_TEST_SUITE (DataSerializerTest) | |
| CPPUNIT_TEST (testReadHeaderFails) | |
| CPPUNIT_TEST (testReadHeader) | |
| CPPUNIT_TEST (testReadHeaderLfLfTerminated) | |
| CPPUNIT_TEST (testReadBodyOfOneChunk) | |
| CPPUNIT_TEST (testReadTwoMessages) | |
| CPPUNIT_TEST (testReadMessageWithInterrupts) | |
| CPPUNIT_TEST (testWriteHeaderFails) | |
| CPPUNIT_TEST (testWriteHeaderOK) | |
| CPPUNIT_TEST (testWriteBodyOfOneChunk) | |
| CPPUNIT_TEST (testWriteBodyOfMultipleChunksWithDelays) | |
| CPPUNIT_TEST (writeTwoMessages) | |
| CPPUNIT_TEST_SUITE_END () | |
Private Attributes | |
| auto_ptr< TransportMock > | transport |
| auto_ptr< ProtocolMock > | protocol |
| auto_ptr< BodyReaderMock > | bodyReader |
| auto_ptr< BodyWriterMock > | bodyWriter |
| auto_ptr< DataSerializer > | serializerReal |
| auto_ptr< DataSerializerDriver > | serializer |
| HeaderBase | header |
| BodyEnd | bodyEnd |
| QList< Data > | chunks |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 235 of file DataSerializerTest.cpp. |
|
|
Definition at line 230 of file DataSerializerTest.cpp. |
|
|
Definition at line 355 of file DataSerializerTest.cpp. |
|
|
Definition at line 350 of file DataSerializerTest.cpp. |
|
|
A body chunk is read from transport through readCodec.
Definition at line 183 of file DataSerializerTest.cpp. |
|
|
The codec cannot read enought data from transport.
Definition at line 195 of file DataSerializerTest.cpp. |
|
|
Reading BodyEnd indicates the end of the body and readCodec is freed.
Definition at line 207 of file DataSerializerTest.cpp. |
|
|
Reading fails if a complete header cannot be read from transport. First serializer tries to read a <CR><LF><CR><LF> terminated header. If that does not work, it tries to read a <LF><LF> terminated header which also fails. Definition at line 134 of file DataSerializerTest.cpp. |
|
|
Read a complete header from transport and create readCodec.
Definition at line 148 of file DataSerializerTest.cpp. |
|
|
Read a complete <LF><LF> terminated header.
Definition at line 164 of file DataSerializerTest.cpp. |
|
||||||||||||
|
A body chunk is written to transport through writeCodec.
Definition at line 332 of file DataSerializerTest.cpp. |
|
|
Writing header fails, no writeCodec for the body is created.
Definition at line 323 of file DataSerializerTest.cpp. |
|
|
After header is written, a writeCodec for the body is created.
Definition at line 312 of file DataSerializerTest.cpp. |
|
||||||||||||
|
Read a body consisting of a number of chunks followed by BodyEnd().
Definition at line 260 of file DataSerializerTest.cpp. |
|
|
We cannot read a header from transport now but we can retry later.
Definition at line 241 of file DataSerializerTest.cpp. |
|
||||||||||||
|
After header is successfully read, we can go on and read the body.
Definition at line 249 of file DataSerializerTest.cpp. |
|
||||||||||||
|
Write a number of body chunks after a header has already been written.
The serializer stops writing the body when a BodyEnd object is received. Afterwards serializer will expect a Header object again. Definition at line 397 of file DataSerializerTest.cpp. |
|
|
Writing header to serializer fails.
Definition at line 366 of file DataSerializerTest.cpp. |
|
|
Write header to serializer.
Definition at line 379 of file DataSerializerTest.cpp. |
|
|
Definition at line 101 of file DataSerializerTest.cpp. |
|
|
Definition at line 225 of file DataSerializerTest.cpp. |
|
|
Definition at line 220 of file DataSerializerTest.cpp. |
|
|
Definition at line 345 of file DataSerializerTest.cpp. |
|
|
Definition at line 340 of file DataSerializerTest.cpp. |
|
|
Definition at line 118 of file DataSerializerTest.cpp. |
|
|
Definition at line 291 of file DataSerializerTest.cpp. |
|
|
Definition at line 281 of file DataSerializerTest.cpp. |
|
|
Definition at line 276 of file DataSerializerTest.cpp. |
|
|
Definition at line 286 of file DataSerializerTest.cpp. |
|
|
Definition at line 303 of file DataSerializerTest.cpp. |
|
|
Definition at line 297 of file DataSerializerTest.cpp. |
|
|
Definition at line 432 of file DataSerializerTest.cpp. |
|
|
Definition at line 426 of file DataSerializerTest.cpp. |
|
|
Definition at line 416 of file DataSerializerTest.cpp. |
|
|
Definition at line 421 of file DataSerializerTest.cpp. |
|
|
Definition at line 440 of file DataSerializerTest.cpp. |
|
|
Definition at line 97 of file DataSerializerTest.cpp. |
|
|
Definition at line 91 of file DataSerializerTest.cpp. |
|
|
Definition at line 92 of file DataSerializerTest.cpp. |
|
|
Definition at line 98 of file DataSerializerTest.cpp. |
|
|
Definition at line 96 of file DataSerializerTest.cpp. |
|
|
Definition at line 90 of file DataSerializerTest.cpp. |
|
|
Definition at line 94 of file DataSerializerTest.cpp. |
|
|
Definition at line 93 of file DataSerializerTest.cpp. |
|
|
Definition at line 89 of file DataSerializerTest.cpp. |