SLOWCLOSE (JANUS DEFINE parameter): Difference between revisions

From m204wiki
Jump to navigation Jump to search
mNo edit summary
m (wordsmithing)
 
(15 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{DISPLAYTITLE:SLOWCLOSE}}
<span class="pageSubtitle">SLOWCLOSE mask &mdash; Don't be hasty closing connections</span>
<span class="pageSubtitle"><section begin="desc" />SLOWCLOSE mask -- don't be hasty closing connections.<section end="desc" /></span>


<var>SLOWCLOSE</var> is a parameter on [[JANUS DEFINE]], which defines and sets characteristics of a Janus port. See the [[JANUS DEFINE#parmlist|List of JANUS DEFINE parameters]].
<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 ''[[Janus Web Server]]'' is to perform a "slow" close of a connection with a browser.  
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. If these two extra characters are sent by the browser, and ''[[Janus Web Server]]'' does not read them from TCP/IP (most of the time it will), then under certain conditions TCP/IP will discard outgoing data from ''Janus Web Server'' when a normal close is done on the socket. To prevent losing this data in this case, ''Janus Web Server'' must perform a more complex and so "slower" and, not incidentally, more expensive close for the connection.  
==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>: ''Janus Web Server'' will only perform "slow" close processing for a POST, and only when it has not already received an extra carriage-return and line-feed.  
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="list">
<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>Slow close for a GET that is followed by extra carriage-return and line-feed characters that are '''not''' read by the Web Server</td></tr>
<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>Slow close for a PUT that is followed by extra carriage-return and line-feed characters that are '''not''' read</td></tr>
<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>Slow close for a POST that is followed by extra carriage-return and line-feed characters, whether the characters are read by the Server or not</td></tr>
<td>Always do a slow close for a POST.</td></tr>
 
<tr><th>X'20'</th>
<tr><th>X'20'</th>
<td>Slow close for a GET that is followed by extra carriage-return and line-feed characters, whether the characters are read or not</td></tr>
<td>Always do a slow close for a GET.</td></tr>
 
<tr><th>X'40'</th>
<tr><th>X'40'</th>
<td>Slow close for a PUT that is followed by extra carriage-return and line-feed characters, whether the characters are read or not
<td>Always do a slow close for a PUT.
</td></tr>
</td></tr>
</table>
</table>


Valid only for WEBSERV ports.
Valid only for <var>[[JANUS DEFINE#type|WEBSERV]]</var> ports.


==References==
==See also==


See: [[List of Janus commands]] | [[JANUS DEFINE#parmlist|List of JANUS DEFINE parameters]].
<ul>
<li>[[List of Janus commands]]
<li>[[JANUS DEFINE#parmlist|List of JANUS DEFINE parameters]]
</ul>


[[Category:JANUS DEFINE parameters|SLOWCLOSE]]
[[Category:JANUS DEFINE parameters|SLOWCLOSE]]

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:

BitMeaning
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.

See also