From c91baadf71b27cc8503e4d62da29ebaffcd583a4 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Tue, 18 Nov 2014 19:18:47 +0000 Subject: [PATCH 08/11] Log when we exceed max_replies_per_connection --- bus/connection.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/bus/connection.c b/bus/connection.c index ec7d1e9..e3ffe41 100644 --- a/bus/connection.c +++ b/bus/connection.c @@ -1827,6 +1827,7 @@ bus_connections_expect_reply (BusConnections *connections, DBusList *link; CancelPendingReplyData *cprd; int count; + int limit; _dbus_assert (will_get_reply != NULL); _dbus_assert (will_send_reply != NULL); @@ -1857,10 +1858,19 @@ bus_connections_expect_reply (BusConnections *connections, if (pending->will_get_reply == will_get_reply) ++count; } - - if (count >= - bus_context_get_max_replies_per_connection (connections->context)) + + limit = bus_context_get_max_replies_per_connection (connections->context); + + if (count >= limit) { + bus_context_log (connections->context, DBUS_SYSTEM_LOG_WARNING, + "The maximum number of pending replies for " + "\"%s\" (%s) has been reached " + "(max_replies_per_connection=%d)", + bus_connection_get_name (will_get_reply), + bus_connection_get_loginfo (will_get_reply), + limit); + dbus_set_error (error, DBUS_ERROR_LIMITS_EXCEEDED, "The maximum number of pending replies per connection has been reached"); return FALSE; -- 2.1.3