task-manager: Add retransmit cleared alert
authorTobias Brunner <tobias@strongswan.org>
Tue, 3 May 2016 09:23:43 +0000 (11:23 +0200)
committerTobias Brunner <tobias@strongswan.org>
Mon, 6 Jun 2016 12:11:01 +0000 (14:11 +0200)
src/libcharon/bus/bus.h
src/libcharon/sa/ikev1/task_manager_v1.c
src/libcharon/sa/ikev2/task_manager_v2.c

index 182ced7..305cbe4 100644 (file)
@@ -105,6 +105,9 @@ enum alert_t {
         * of the retransmit, if the message got fragmented only the first fragment
         * is passed */
        ALERT_RETRANSMIT_SEND,
+       /** received response for retransmitted request, argument is packet_t, if
+        * the message got fragmented only the first fragment is passed */
+       ALERT_RETRANSMIT_SEND_CLEARED,
        /** sending retransmits timed out, argument is packet_t, if available and if
         *  the message got fragmented only the first fragment is passed */
        ALERT_RETRANSMIT_SEND_TIMEOUT,
index ea1177d..126863a 100644 (file)
@@ -1181,6 +1181,12 @@ static status_t process_response(private_task_manager_t *this,
        }
        enumerator->destroy(enumerator);
 
+       if (this->initiating.retransmitted)
+       {
+               packet_t *packet = NULL;
+               array_get(this->initiating.packets, 0, &packet);
+               charon->bus->alert(charon->bus, ALERT_RETRANSMIT_SEND_CLEARED, packet);
+       }
        this->initiating.type = EXCHANGE_TYPE_UNDEFINED;
        clear_packets(this->initiating.packets);
 
index abbffb2..702c383 100644 (file)
@@ -695,6 +695,13 @@ static status_t process_response(private_task_manager_t *this,
        }
        enumerator->destroy(enumerator);
 
+       if (this->initiating.retransmitted)
+       {
+               packet_t *packet = NULL;
+               array_get(this->initiating.packets, 0, &packet);
+               charon->bus->alert(charon->bus, ALERT_RETRANSMIT_SEND_CLEARED, packet);
+       }
+
        /* catch if we get resetted while processing */
        this->reset = FALSE;
        enumerator = array_create_enumerator(this->active_tasks);