changeset 71:cba30013d8f5

Added debug messages
author Sebastien Decugis <sdecugis@nict.go.jp>
date Tue, 01 Dec 2009 11:27:17 +0900
parents 65b32c93f21e
children 57ffd98dbe96
files freeDiameter/p_sr.c
diffstat 1 files changed, 14 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/freeDiameter/p_sr.c	Tue Dec 01 11:08:23 2009 +0900
+++ b/freeDiameter/p_sr.c	Tue Dec 01 11:27:17 2009 +0900
@@ -57,6 +57,18 @@
 	return li;
 }
 
+static void srl_dump(const char * text, struct fd_list * srlist)
+{
+	struct fd_list * li;
+	fd_log_debug("%sSentReq list @%p:\n", text, srlist);
+	for (li = srlist->next; li != srlist; li = li->next) {
+		struct sentreq * sr = (struct sentreq *)li;
+		uint32_t * nexthbh = li->o;
+		fd_log_debug(" - Next req (%x):\n", *nexthbh);
+		fd_msg_dump_one(INFO, sr->req);
+	}
+}
+
 /* Store a new sent request */
 int fd_p_sr_store(struct sr_list * srlist, struct msg **req, uint32_t *hbhloc)
 {
@@ -85,6 +97,7 @@
 	/* Save in the list */
 	*req = NULL;
 	fd_list_insert_before(next, &sr->chain);
+	srl_dump("Saved new request, ", &srlist->srs);
 	CHECK_POSIX( pthread_mutex_unlock(&srlist->mtx) );
 	return 0;
 }
@@ -100,6 +113,7 @@
 	
 	/* Search the request in the list */
 	CHECK_POSIX( pthread_mutex_lock(&srlist->mtx) );
+	srl_dump("Fetching a request, ", &srlist->srs);
 	sr = (struct sentreq *)find_or_next(&srlist->srs, hbh, &match);
 	if (!match) {
 		TRACE_DEBUG(INFO, "There is no saved request with this hop-by-hop id");
"Welcome to our mercurial repository"