Synchronet now requires the libarchive development package (e.g. libarchive-dev on Debian-based Linux distros, libarchive.org for more info) to build successfully.

Commit 7a6e1b5c authored by deuce's avatar deuce

Check if TCP timestamps are enabled, and if they are, subtract 12 from the

MSS for the packet size.

Fixes problem with telnet server where large transfers were full packets
followed by a 12 byte packet.  Also removes hack in webserver that always
assumed timestamps were enabled.

The Win32 code has not been tested, but is assumed to work perfectly.
parent 3b306d11
......@@ -2297,6 +2297,26 @@ void output_thread(void* arg)
&i, &sl)) {
/* Check for sanity... */
if(i>100) {
#ifdef _WIN32
#ifdef TCP_TIMESTAMPS
DWORD ts;
sl = sizeof(ts);
if (!getsockopt(sbbs->client_socket, IPPROTO_TCP, TCP_TIMESTAMPS, (char *)&ts, &sl)) {
if (ts)
i -= 12;
}
#endif
#else
#if (defined(TCP_INFO) && defined(TCPI_OPT_TIMESTAMPS))
struct tcp_info tcpi;
sl = sizeof(tcpi);
if (!getsockopt(sbbs->client_socket, IPPROTO_TCP, TCP_INFO,&tcpi, &sl)) {
if (tcpi.tcpi_options & TCPI_OPT_TIMESTAMPS)
i -= 12;
}
#endif
#endif
sbbs->outbuf.highwater_mark=i;
lprintf(LOG_DEBUG,"Autotuning outbuf highwater mark to %d based on MSS",i);
mss=sbbs->outbuf.highwater_mark;
......
......@@ -6286,7 +6286,27 @@ void http_output_thread(void *arg)
if(!getsockopt(session->socket, IPPROTO_TCP, TCP_MAXSEG, (char*)&i, &sl)) {
/* Check for sanity... */
if(i>100) {
obuf->highwater_mark=i-12;
#ifdef _WIN32
#ifdef TCP_TIMESTAMPS
DWORD ts;
sl = sizeof(ts);
if (!getsockopt(session->socket, IPPROTO_TCP, TCP_TIMESTAMPS, (char *)&ts, &sl)) {
if (ts)
i -= 12;
}
#endif
#else
#if (defined(TCP_INFO) && defined(TCPI_OPT_TIMESTAMPS))
struct tcp_info tcpi;
sl = sizeof(tcpi);
if (!getsockopt(session->socket, IPPROTO_TCP, TCP_INFO,&tcpi, &sl)) {
if (tcpi.tcpi_options & TCPI_OPT_TIMESTAMPS)
i -= 12;
}
#endif
#endif
obuf->highwater_mark=i;
lprintf(LOG_DEBUG,"%04d Autotuning outbuf highwater mark to %d based on MSS"
,session->socket,i);
mss=obuf->highwater_mark;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment