diff options
author | Martin Willi <martin@strongswan.org> | 2007-07-03 08:50:14 +0000 |
---|---|---|
committer | Martin Willi <martin@strongswan.org> | 2007-07-03 08:50:14 +0000 |
commit | cba7ba7f9dc5bb7d2b273721ed326bd503254d9c (patch) | |
tree | 5ecabb753463667a668b08123fed010b26054176 /src/charon/encoding/message.c | |
parent | bcac22f3a67f582980810bcead2b50ed3ad1310f (diff) | |
download | strongswan-cba7ba7f9dc5bb7d2b273721ed326bd503254d9c.tar.bz2 strongswan-cba7ba7f9dc5bb7d2b273721ed326bd503254d9c.tar.xz |
show kind of notify contained in messages in log
Diffstat (limited to 'src/charon/encoding/message.c')
-rw-r--r-- | src/charon/encoding/message.c | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/src/charon/encoding/message.c b/src/charon/encoding/message.c index b31b21afa..a32165943 100644 --- a/src/charon/encoding/message.c +++ b/src/charon/encoding/message.c @@ -621,16 +621,10 @@ static char* get_string(private_message_t *this, char *buf, int len) pos += written; len -= written; - if (this->payloads->get_count(this->payloads) == 0) - { - snprintf(pos, len, "]"); - return buf; - } - iterator = this->payloads->create_iterator(this->payloads, TRUE); while (iterator->iterate(iterator, (void**)&payload)) { - written = snprintf(pos, len, "%N ", payload_type_short_names, + written = snprintf(pos, len, " %N", payload_type_short_names, payload->get_type(payload)); if (written >= len || written < 0) { @@ -638,13 +632,23 @@ static char* get_string(private_message_t *this, char *buf, int len) } pos += written; len -= written; + if (payload->get_type(payload) == NOTIFY) + { + notify_payload_t *notify = (notify_payload_t*)payload; + written = snprintf(pos, len, "(%N)", notify_type_short_names, + notify->get_notify_type(notify)); + if (written >= len || written < 0) + { + return buf; + } + pos += written; + len -= written; + } } iterator->destroy(iterator); /* remove last space */ - pos--; - len++; - snprintf(pos, len, "]"); + snprintf(pos, len, " ]"); return buf; } @@ -734,7 +738,7 @@ static status_t generate(private_message_t *this, crypter_t *crypter, signer_t* iterator_t *iterator; status_t status; chunk_t packet_data; - char str[128]; + char str[256]; if (is_encoded(this)) { @@ -1140,7 +1144,7 @@ static status_t parse_body(private_message_t *this, crypter_t *crypter, signer_t { status_t status = SUCCESS; payload_type_t current_payload_type; - char str[128]; + char str[256]; current_payload_type = this->first_payload; |