blob: c4f1622eb8cf941882031dd345d214083102aa5a (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
--- http_load.c.old Tue Dec 9 02:22:07 2003
+++ http_load.c Tue Dec 9 03:43:39 2003
@@ -825,6 +825,7 @@
ClientData client_data;
int flags;
int sip_num;
+ int rcv_bytes, error;
/* Start filling in the connection slot. */
connections[cnum].url_num = url_num;
@@ -863,6 +864,16 @@
perror( urls[url_num].url_str );
(void) close( connections[cnum].conn_fd );
return;
+ }
+
+ /* Shrink the recieve window to better imitate a slow connection. */
+ if ( do_throttle )
+ {
+ rcv_bytes = 2048;
+ error = setsockopt(connections[cnum].conn_fd, SOL_SOCKET, SO_RCVBUF,
+ (void *)&rcv_bytes, sizeof(rcv_bytes));
+ if (error)
+ perror("Setsockopt problem:");
}
if ( num_sips > 0 )
|