X-Git-Url: http://www.project-moonshot.org/gitweb/?p=trust_router.git;a=blobdiff_plain;f=trp%2Ftrps.c;h=32a7de1d0c4f59caff88d50c834c18a5c5a311ab;hp=b8895d1d791be80d44c507f9576ad6329757ecaf;hb=81a61f8c6064bf52ff2a40a3d28e6ee5b2e478d4;hpb=3feea37388d58efac91a7e10b85043bb52c8bf19 diff --git a/trp/trps.c b/trp/trps.c index b8895d1..32a7de1 100644 --- a/trp/trps.c +++ b/trp/trps.c @@ -265,13 +265,13 @@ TRP_RC trps_send_msg(TRPS_INSTANCE *trps, TRP_PEER *peer, const char *msg) /* get the connection for this peer */ trpc=trps_find_trpc(trps, peer); - /* instead, let's let that happen and then clear the queue when an attempt to - * connect fails */ + /* The peer connection (trpc) usually exists even if the connection is down. + * We will queue messages even if the connection is down. To prevent this from + * endlessly increasing the size of the queue, the trpc handler needs to clear + * its queue periodically, even if it is unable to send the messages + */ if (trpc==NULL) { tr_warning("trps_send_msg: skipping message queued for missing TRP client entry."); - } else if (trpc->shutting_down) { - tr_debug("trps_send_msg: skipping message because TRP client is shutting down."); - rc = TRP_SUCCESS; /* it's ok that this didn't get sent, the connection will be gone in a moment */ } else { mq_msg=tr_mq_msg_new(tmp_ctx, TR_MQMSG_TRPC_SEND, TR_MQ_PRIO_NORMAL); msg_dup=talloc_strdup(mq_msg, msg); /* get local copy in mq_msg context */