added message ID to message log
authorMartin Willi <martin@strongswan.org>
Tue, 3 Jul 2007 09:00:16 +0000 (09:00 -0000)
committerMartin Willi <martin@strongswan.org>
Tue, 3 Jul 2007 09:00:16 +0000 (09:00 -0000)
src/charon/encoding/message.c

index a321659..980ff12 100644 (file)
@@ -611,9 +611,13 @@ static char* get_string(private_message_t *this, char *buf, int len)
        int written;
        char *pos = buf;
        
-       written = snprintf(pos, len, "%N %s [", 
-                                          exchange_type_names, this->exchange_type,
-                                          this->is_request ? "request" : "response");
+       memset(buf, 0, len);
+       len--;
+       
+       written = snprintf(pos, len, "%N %s %d [",
+                                          exchange_type_names, this->exchange_type, 
+                                          this->is_request ? "request" : "response",
+                                          this->message_id);
        if (written >= len || written < 0)
        {
                return "";