SLOWCLOSE (JANUS DEFINE parameter): Difference between revisions
m (1 revision) |
m (wordsmithing) |
||
(10 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
<span class="pageSubtitle">SLOWCLOSE mask — Don't be hasty closing connections</span> | |||
<span class="pageSubtitle" | |||
<var>SLOWCLOSE</var> is a parameter on [[JANUS DEFINE]], which defines and sets characteristics of a Janus port. | <var>SLOWCLOSE</var> is a parameter on <var>[[JANUS DEFINE]]</var>, which defines and sets characteristics of a Janus port. | ||
The <var>SLOWCLOSE</var> parameter is followed by a bitmask that indicates the conditions under which | The <var>SLOWCLOSE</var> parameter is followed by a bitmask that indicates the conditions under which <var class="product">[[Janus Web Server]]</var> is to perform a "slow" close of a connection with a browser. | ||
This parameter is useful for dealing with a bug in some browsers that sends an extra, junk, carriage-return and line-feed character after the contents of an HTTP POST | ==Description== | ||
This parameter is useful for dealing with a bug in some browsers that sends an extra, junk, carriage-return and line-feed character after the contents of an HTTP POST. | |||
This parameter defaults to <code>X'01'</code>: | This is the problematic scenario <var>SLOWCLOSE</var> is designed for. If both of the following are true, then Janus has no way of knowing if these junk characters follow: | ||
<ul> | |||
<li>The two extra characters are sent by the browser (nowadays they almost certainly are <i>not</i>) </li> | |||
<li><var class="product">Janus Web Server</var> has not read the characters from TCP/IP (when this used to happen, the characters would usually be in the data Janus has already read) </li> | |||
</ul> | |||
Although this scenario probably just does not happen anymore, under certain conditions when it did in the past TCP/IP might discard outgoing data from <var class="product">Janus Web Server</var> when a normal close was done on the socket. | |||
To prevent this rare loss of data, <var class="product">Janus Web Server</var> can perform a more complex and so "slower" and, not incidentally, more expensive close for the connection. | |||
This parameter defaults to <code>X'01'</code>. However: | |||
<p class="note"><b>Note:</b> With the passage of time, <var>SLOWCLOSE</var> processing has become an anachronism, and setting it to 0 on Janus Web ports is recommended.</p> | |||
While the default setting covers the known browser bug which only seems to occur on POSTs, <var>SLOWCLOSE</var> can be set to other values for other request types. These settings should only be necessary if browsers that send junk characters under other conditions are discovered: | While the default setting covers the known browser bug which only seems to occur on POSTs, <var>SLOWCLOSE</var> can be set to other values for other request types. These settings should only be necessary if browsers that send junk characters under other conditions are discovered: | ||
<table class=" | <table class="thJustBold"> | ||
<tr class="head"><th>Bit</th><th>Meaning</th> | |||
<tr><th>X'01'</th> | |||
<td>Perform "slow" close processing for a POST, if and only if Janus Web has not already received an extra carriage-return and line-feed. This is the default value. </td></tr> | |||
<tr><th>X'02'</th> | <tr><th>X'02'</th> | ||
<td> | <td>Perform "slow" close processing for a GET, if and only if Janus Web has not already received an extra carriage-return and line-feed.</td></tr> | ||
<tr><th>X'04'</th> | <tr><th>X'04'</th> | ||
<td> | <td>Perform "slow" close processing for a PUT, if and only if Janus Web has not already received an extra carriage-return and line-feed.</td></tr> | ||
<tr><th>X'10'</th> | <tr><th>X'10'</th> | ||
<td> | <td>Always do a slow close for a POST.</td></tr> | ||
<tr><th>X'20'</th> | <tr><th>X'20'</th> | ||
<td> | <td>Always do a slow close for a GET.</td></tr> | ||
<tr><th>X'40'</th> | <tr><th>X'40'</th> | ||
<td> | <td>Always do a slow close for a PUT. | ||
</td></tr> | </td></tr> | ||
</table> | </table> |
Latest revision as of 16:45, 15 March 2017
SLOWCLOSE mask — Don't be hasty closing connections
SLOWCLOSE is a parameter on JANUS DEFINE, which defines and sets characteristics of a Janus port.
The SLOWCLOSE parameter is followed by a bitmask that indicates the conditions under which Janus Web Server is to perform a "slow" close of a connection with a browser.
Description
This parameter is useful for dealing with a bug in some browsers that sends an extra, junk, carriage-return and line-feed character after the contents of an HTTP POST.
This is the problematic scenario SLOWCLOSE is designed for. If both of the following are true, then Janus has no way of knowing if these junk characters follow:
- The two extra characters are sent by the browser (nowadays they almost certainly are not)
- Janus Web Server has not read the characters from TCP/IP (when this used to happen, the characters would usually be in the data Janus has already read)
Although this scenario probably just does not happen anymore, under certain conditions when it did in the past TCP/IP might discard outgoing data from Janus Web Server when a normal close was done on the socket.
To prevent this rare loss of data, Janus Web Server can perform a more complex and so "slower" and, not incidentally, more expensive close for the connection.
This parameter defaults to X'01'
. However:
Note: With the passage of time, SLOWCLOSE processing has become an anachronism, and setting it to 0 on Janus Web ports is recommended.
While the default setting covers the known browser bug which only seems to occur on POSTs, SLOWCLOSE can be set to other values for other request types. These settings should only be necessary if browsers that send junk characters under other conditions are discovered:
Bit | Meaning |
---|---|
X'01' | Perform "slow" close processing for a POST, if and only if Janus Web has not already received an extra carriage-return and line-feed. This is the default value. |
X'02' | Perform "slow" close processing for a GET, if and only if Janus Web has not already received an extra carriage-return and line-feed. |
X'04' | Perform "slow" close processing for a PUT, if and only if Janus Web has not already received an extra carriage-return and line-feed. |
X'10' | Always do a slow close for a POST. |
X'20' | Always do a slow close for a GET. |
X'40' | Always do a slow close for a PUT. |
Valid only for WEBSERV ports.