Index: src/include/httpd.h
===================================================================
--- src/include/httpd.h	(revision 157957)
+++ src/include/httpd.h	(working copy)
@@ -927,6 +927,8 @@
     int limit_req_line;      /* limit on size of the HTTP request line    */
     int limit_req_fieldsize; /* limit on size of any request header field */
     int limit_req_fields;    /* limit on number of request header fields  */
+
+    int receive_buffer_size;	/* size of TCP receive buffer (in bytes) */
 };
 
 /* These are more like real hosts than virtual hosts */
Index: src/main/http_main.c
===================================================================
--- src/main/http_main.c	(revision 157957)
+++ src/main/http_main.c	(working copy)
@@ -3768,6 +3768,17 @@
 	}
     }
 #endif
+#if !defined(BEOS) && defined(SO_RCVBUF) 
+    if (server_conf->receive_buffer_size) {
+	if (setsockopt(s, SOL_SOCKET, SO_RCVBUF,
+		(char *) &server_conf->receive_buffer_size, sizeof(int)) < 0) {
+	    ap_log_error(APLOG_MARK, APLOG_WARNING, server_conf,
+			"make_sock: failed to set ReceiveBufferSize for %s, "
+			"using default", addr);
+	    /* not a fatal error */
+	}
+    }
+#endif 
 
 #ifdef MPE
 /* MPE requires CAP=PM and GETPRIVMODE to bind to ports less than 1024 */
Index: src/main/http_core.c
===================================================================
--- src/main/http_core.c	(revision 157957)
+++ src/main/http_core.c	(working copy)
@@ -2137,6 +2137,21 @@
     return NULL;
 }
 
+static const char *set_receive_buffer_size(cmd_parms *cmd, void *dummy, char *arg)
+{
+    int s = atoi(arg);
+    const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
+    if (err != NULL) {
+        return err;
+    }
+
+    if (s < 512 && s != 0) {
+        return "ReceiveBufferSize must be >= 512 bytes, or 0 for system default.";
+    }
+    cmd->server->receive_buffer_size = s;
+    return NULL;
+}
+
 static const char *set_user(cmd_parms *cmd, void *dummy, char *arg)
 {
 #ifdef WIN32
@@ -3626,6 +3641,8 @@
   "A port number or a numeric IP address and a port number"},
 { "SendBufferSize", set_send_buffer_size, NULL, RSRC_CONF, TAKE1,
   "Send buffer size in bytes"},
+{ "ReceiveBufferSize", set_receive_buffer_size, NULL, RSRC_CONF, TAKE1,
+  "Receive buffer size in bytes"},
 { "AddModule", add_module_command, NULL, RSRC_CONF, ITERATE,
   "The name of a module" },
 { "ClearModuleList", clear_module_list_command, NULL, RSRC_CONF, NO_ARGS, 
