12.11.2014 Views

web server - Borland Technical Publications

web server - Borland Technical Publications

web server - Borland Technical Publications

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Large data transfer<br />

Note If you specify an invalid value (non numeric/negative number) then the default 4096<br />

value is employed.<br />

Known content length versus unknown<br />

Based on whether content length is known in advance or not, chunked upload mode<br />

can take one of the following two paths:<br />

■<br />

■<br />

chunked upload with known content length<br />

chunked upload with unknown content length<br />

Chunked upload with known content length<br />

In this case, the client knows the content length of the data in advance of the transfer.<br />

The client sets the Content-Length HTTP header before writing out the data. The client<br />

writes out a single response header followed by multiple chunks of data. Apache<br />

receives this from the browser and sends data in the same fashion to the <strong>Borland</strong> <strong>web</strong><br />

container.<br />

The response header contains the following header:<br />

Content-Length=<br />

Chunked upload with unknown content length<br />

HTTP protocol version 1.1 adds a new feature to handle the case of data transfer when<br />

data length is not known in advance. This feature is called HTTP chunking.<br />

In this case, a client does not know the content length of the data in advance of a<br />

transfer. The client does not set the Content-Length HTTP request header. Instead, the<br />

client sets the Transfer-Encoding HTTP request header to a value of chunked as follows:<br />

Transfer-Encoding="chunked"<br />

The client sends the data to the Apache <strong>web</strong> <strong>server</strong> as “HTTP chunks”; a single<br />

request header followed by multiple combinations of chunk header, chunk data, and<br />

chunk trailer.<br />

When the Apache <strong>web</strong> <strong>server</strong> sees this Transfer-Encoding header, it strips out the<br />

chunk header and chunk trailers and sends the data as normal data chunks to the<br />

<strong>Borland</strong> <strong>web</strong> container.<br />

At this time, no major browsers support uploading data without knowing the content<br />

length. In other words, browsers never add a Transfer-Encoding="chunked" header to an<br />

HTTP request. However, a non-browser client can add this header to an HTTP<br />

request.<br />

Implementing non-chunked upload<br />

This is the default transfer of data mode for the IIOP connector. In the non-chunked<br />

upload mode, the Apache <strong>web</strong> <strong>server</strong> waits until it has all the data to send. Then it<br />

calculates the content length and sets the Content-Length header to the actual content<br />

length. Apache then sends the request header followed by a single huge data block.<br />

This mode of transfer has high memory requirements both on the Apache <strong>web</strong> <strong>server</strong><br />

and the <strong>Borland</strong> <strong>web</strong> container, because the data is cached until all of it is available.<br />

The non-chunked upload mode of transfer has no overhead of extra thread per each<br />

request (in the <strong>Borland</strong> <strong>web</strong> container). This download mode works well under both the<br />

HTTP protocol versions 1.0 and 1.1, because the Transfer-Encoding header is never<br />

set in this mode.<br />

Chapter 5: Web <strong>server</strong> to <strong>web</strong> container connectivity 51

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!