version 1.43, 2001/01/13 18:32:50 |
version 1.44, 2001/01/13 18:36:45 |
|
|
packet_set_interactive(int interactive) |
packet_set_interactive(int interactive) |
{ |
{ |
static int called = 0; |
static int called = 0; |
|
int lowdelay = IPTOS_LOWDELAY; |
|
int throughput = IPTOS_THROUGHPUT; |
|
int on = 1; |
|
|
if (called) |
if (called) |
return; |
return; |
called = 1; |
called = 1; |
|
|
* IPTOS_LOWDELAY and TCP_NODELAY. |
* IPTOS_LOWDELAY and TCP_NODELAY. |
*/ |
*/ |
if (packet_connection_is_ipv4()) { |
if (packet_connection_is_ipv4()) { |
int lowdelay = IPTOS_LOWDELAY; |
|
if (setsockopt(connection_in, IPPROTO_IP, IP_TOS, |
if (setsockopt(connection_in, IPPROTO_IP, IP_TOS, |
(void *) &lowdelay, sizeof(lowdelay)) < 0) |
(void *) &lowdelay, sizeof(lowdelay)) < 0) |
error("setsockopt IPTOS_LOWDELAY: %.100s", |
error("setsockopt IPTOS_LOWDELAY: %.100s", |
|
|
* Set IP options for a non-interactive connection. Use |
* Set IP options for a non-interactive connection. Use |
* IPTOS_THROUGHPUT. |
* IPTOS_THROUGHPUT. |
*/ |
*/ |
int throughput = IPTOS_THROUGHPUT; |
|
if (setsockopt(connection_in, IPPROTO_IP, IP_TOS, (void *) &throughput, |
if (setsockopt(connection_in, IPPROTO_IP, IP_TOS, (void *) &throughput, |
sizeof(throughput)) < 0) |
sizeof(throughput)) < 0) |
error("setsockopt IPTOS_THROUGHPUT: %.100s", strerror(errno)); |
error("setsockopt IPTOS_THROUGHPUT: %.100s", strerror(errno)); |