From cabf789a951d94b8decd54d10637b5fe9bfadb01 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Tue, 18 Nov 2014 19:18:47 +0000 Subject: [PATCH 05/13] 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 61b2c4b..abcc50b 100644 --- a/bus/connection.c +++ b/bus/connection.c @@ -1898,6 +1898,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); @@ -1928,10 +1929,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.8.1