From 5854a9f9ebf866c9d3ec16a5dfbfd4fe577419d2 Mon Sep 17 00:00:00 2001 From: silby Date: Sun, 14 Dec 2003 05:17:54 +0000 Subject: Add a patch to the port which improves the -throttle option by shrinking the receive socket buffer size to 2K. The patch has been submitted to http_load's author for possible inclusion in future versions of http_load. --- www/http_load/Makefile | 1 + www/http_load/files/patch-aa | 27 +++++++++++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 www/http_load/files/patch-aa (limited to 'www') diff --git a/www/http_load/Makefile b/www/http_load/Makefile index 838ed9d3618..7b66bba7b7d 100644 --- a/www/http_load/Makefile +++ b/www/http_load/Makefile @@ -7,6 +7,7 @@ PORTNAME= http_load PORTVERSION= 20020104 +PORTREVISION= 1 CATEGORIES= www MASTER_SITES= http://www.acme.com/software/http_load/ DISTNAME= ${PORTNAME}-04jan2002 diff --git a/www/http_load/files/patch-aa b/www/http_load/files/patch-aa new file mode 100644 index 00000000000..c4f1622eb8c --- /dev/null +++ b/www/http_load/files/patch-aa @@ -0,0 +1,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 ) -- cgit