user manual
54 BES Developer’s Guide
Large data transfer
Chunked upload with known content length
In this case, the client knows the content length of the data in advance of the
transfer. The client sets the Content-Length HTTP header before writing out the
data. The client writes out a single response header followed by multiple
chunks of data. Apache receives this from the browser and sends data in the
same fashion to the Borland web container.
The response header contains the following header:
Content-Length=<actual data size>
Chunked upload with unknown content length
HTTP protocol version 1.1 adds a new feature to handle the case of data
transfer when data length is not known in advance. This feature is called
HTTP chunking.
In this case, a client does not know the content length of the data in advance
of a transfer. The client does not set the Content-Length HTTP request header.
Instead, the client sets the Transfer-Encoding HTTP request header to a value
of chunked as follows:
Transfer-Encoding="chunked"
The client sends the data to the Apache web server as "HTTP chunks"; a
single request header followed by multiple combinations of chunk header,
chunk data, and chunk trailer.
When the Apache web server sees this Transfer-Encoding header, it strips out
the chunk header and chunk trailers and sends the data as normal data
chunks to the Borland web container.
At this time, no major browsers support uploading data without knowing the
content length. In other words, browsers never add a Transfer-
Encoding="chunked" header to an HTTP request. However, a non-browser client
can add this header to an HTTP request.
Implementing non-chunked upload
This is the default transfer of data mode for the IIOP connector. In the non-
chunked upload mode, the Apache web server waits until it has all the data to
send. Then it calculates the content length and sets the Content-Length header
to the actual content length. Apache then sends the request header followed
by a single huge data block.
This mode of transfer has high memory requirements both on the Apache web
server and the Borland web container, because the data is cached until all of it
is available.
The non-chunked upload mode of transfer has no overhead of extra thread
per each request (in the Borland web container). This download mode works
well under both the HTTP protocol versions 1.0 and 1.1, because the Transfer-
Encoding header is never set in this mode.










