jerenkrantz 2003/02/12 14:50:59
Modified: flood CHANGES flood_profile.c flood_socket_generic.c
flood_socket_generic.h
Log:
Added generic_fullresp_recv_resp() to force full response.
This patch adds a new handler that always retrieves the entire response.
This handler is needed because we currently do not have a way to tell
flood to always retrieve the entire response. We have a "wantresponse"
flag that tells the socket code whether or not to retrieve the entire
response. Handlers such as round_robin_create_req() set this flag based
on varying factors. With the new generic_fullresp_recv_resp() handler,
you can specify it in your <profile> section like this:
<recv_resp>generic_fullresp_recv_resp</recv_resp>
to cause flood to retrieve the entire response.
When used with the handler:
relative_times_process_stats
you can measure the total bytes sent and received with each request
and response.
Submitted by: Phi-Long Tran <[EMAIL PROTECTED]>
Reviewed by: Justin Erenkrantz
Revision Changes Path
1.47 +3 -0 httpd-test/flood/CHANGES
Index: CHANGES
===================================================================
RCS file: /home/cvs/httpd-test/flood/CHANGES,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -u -r1.46 -r1.47
--- CHANGES 12 Feb 2003 22:44:55 -0000 1.46
+++ CHANGES 12 Feb 2003 22:50:58 -0000 1.47
@@ -1,5 +1,8 @@
Changes since 1.0:
+* Added generic_fullresp_recv_resp() to force full response.
+ [Phi-Long Tran <[EMAIL PROTECTED]>]
+
* Fixed compiler warning about signed/unsigned mismatch in generic_recv_resp.
[Phi-Long Tran <[EMAIL PROTECTED]>]
1.24 +3 -0 httpd-test/flood/flood_profile.c
Index: flood_profile.c
===================================================================
RCS file: /home/cvs/httpd-test/flood/flood_profile.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -u -r1.23 -r1.24
--- flood_profile.c 7 Feb 2003 07:39:21 -0000 1.23
+++ flood_profile.c 12 Feb 2003 22:50:58 -0000 1.24
@@ -252,6 +252,9 @@
/* Alternative Implementations that are currently available: */
+ /* Always retrieve the full response */
+ {"recv_resp", "generic_fullresp_recv_resp",
&generic_fullresp_recv_resp},
+
/* Keep-Alive support */
{"socket_init", "keepalive_socket_init", &keepalive_socket_init},
{"begin_conn", "keepalive_begin_conn", &keepalive_begin_conn},
1.10 +20 -0 httpd-test/flood/flood_socket_generic.c
Index: flood_socket_generic.c
===================================================================
RCS file: /home/cvs/httpd-test/flood/flood_socket_generic.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -u -r1.9 -r1.10
--- flood_socket_generic.c 12 Feb 2003 22:44:55 -0000 1.9
+++ flood_socket_generic.c 12 Feb 2003 22:50:59 -0000 1.10
@@ -201,6 +201,26 @@
}
/**
+ * This implementation always retrieves the full response.
+ * We temporarily set the "wantresponse" flag to true and
+ * call generic_recv_resp() to do the real work.
+ */
+apr_status_t generic_fullresp_recv_resp(response_t **resp,
+ socket_t *sock,
+ apr_pool_t *pool)
+{
+ generic_socket_t *gsock = (generic_socket_t *)sock;
+ int orig_wantresponse = gsock->wantresponse;
+ apr_status_t status;
+
+ gsock->wantresponse = 1;
+ status = generic_recv_resp(resp, sock, pool);
+ gsock->wantresponse = orig_wantresponse;
+
+ return status;
+}
+
+/**
* Generic implementation for end_conn.
*/
apr_status_t generic_end_conn(socket_t *sock, request_t *req, response_t
*resp)
1.4 +1 -0 httpd-test/flood/flood_socket_generic.h
Index: flood_socket_generic.h
===================================================================
RCS file: /home/cvs/httpd-test/flood/flood_socket_generic.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -u -r1.3 -r1.4
--- flood_socket_generic.h 3 Feb 2003 17:10:56 -0000 1.3
+++ flood_socket_generic.h 12 Feb 2003 22:50:59 -0000 1.4
@@ -62,6 +62,7 @@
apr_status_t generic_socket_init(socket_t **sock, apr_pool_t *pool);
apr_status_t generic_begin_conn(socket_t *sock, request_t *req, apr_pool_t
*pool);
apr_status_t generic_send_req(socket_t *sock, request_t *req, apr_pool_t
*pool);
+apr_status_t generic_fullresp_recv_resp(response_t **resp, socket_t *sock,
apr_pool_t *pool);
apr_status_t generic_recv_resp(response_t **resp, socket_t *sock, apr_pool_t
*pool);
apr_status_t generic_end_conn(socket_t *sock, request_t *req, response_t
*resp);
apr_status_t generic_socket_destroy(socket_t *socket);