From be64c8c445a21e9d932bf103c38f07bf73ffa6b4 Mon Sep 17 00:00:00 2001 From: Thomas Porzelt Date: Sun, 13 Jun 2010 21:56:08 +0200 Subject: [PATCH] [mod_debug] Add some more info to connection struct dump --- src/modules/mod_debug.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/modules/mod_debug.c b/src/modules/mod_debug.c index f84cbfe..802a562 100644 --- a/src/modules/mod_debug.c +++ b/src/modules/mod_debug.c @@ -85,6 +85,7 @@ typedef struct mod_debug_job_t mod_debug_job_t; /* the CollectFunc */ static gpointer debug_collect_func(liWorker *wrk, gpointer fdata) { GArray *cons; + guint len; mod_debug_job_t *job = fdata; /* gather connection info */ @@ -122,9 +123,11 @@ static gpointer debug_collect_func(liWorker *wrk, gpointer fdata) { cd->detailed = g_string_sized_new(1023); g_string_append_printf(cd->detailed, "
connection* @ %p = {\n", (void*)cd->con);
+				g_string_append_printf(cd->detailed, "	fd = %d,\n", cd->fd);
 				g_string_append_printf(cd->detailed, "	remote_addr_str = \"%s\",\n", cd->remote_addr_str->str);
 				g_string_append_printf(cd->detailed, "	local_addr_str = \"%s\",\n", cd->local_addr_str->str);
-				g_string_append_printf(cd->detailed, "	fd = %d,\n", cd->fd);
+				g_string_append_printf(cd->detailed, "	is_ssl = \"%s\",\n", cd->is_ssl ? "true" : "false");
+				g_string_append_printf(cd->detailed, "	keep_alive = \"%s\",\n", cd->keep_alive ? "true" : "false");
 				g_string_append_printf(cd->detailed, "	state = \"%s\",\n", li_connection_state_str(cd->state));
 				g_string_append_printf(cd->detailed, "	ts_started = %f,\n", cd->ts_started);
 				g_string_append_printf(cd->detailed,
@@ -147,6 +150,20 @@ static gpointer debug_collect_func(liWorker *wrk, gpointer fdata) {
 					"	}\n",
 					cd->bytes_in, cd->bytes_out
 				);
+				g_string_append_printf(cd->detailed,
+					"	mainvr = {\n"
+					"		request = {\n"
+					"			method = \"%s\"\n"
+					"			host = \"%s\"\n"
+					"			path = \"%s\"\n"
+					"			query = \"%s\"\n"
+					"		}\n"
+					"	}\n",
+					li_http_method_string(cd->method, &len),
+					cd->host->str,
+					cd->path->str,
+					cd->query->str
+				);
 				g_string_append_len(cd->detailed, CONST_STR_LEN("}
")); } }