Mercurial > hg > freeDiameter
comparison libfdproto/messages.c @ 1562:6219359a36a9 default tip
Merge latest changes from proposed branch
author | Sebastien Decugis <sdecugis@freediameter.net> |
---|---|
date | Mon, 21 Jun 2021 19:08:18 +0800 |
parents | 2dbc816d48f4 |
children |
comparison
equal
deleted
inserted
replaced
1558:932fca1cbbe4 | 1562:6219359a36a9 |
---|---|
1774 | 1774 |
1775 /* Then we must write the AVP value */ | 1775 /* Then we must write the AVP value */ |
1776 | 1776 |
1777 if (avp->avp_model == NULL) { | 1777 if (avp->avp_model == NULL) { |
1778 /* In the case where we don't know the type of AVP, just copy the raw data or source */ | 1778 /* In the case where we don't know the type of AVP, just copy the raw data or source */ |
1779 CHECK_PARAMS( avp->avp_source || avp->avp_rawdata ); | 1779 /* there might be no data if the AVP is empty */ |
1780 | 1780 |
1781 if ( avp->avp_rawdata != NULL ) { | 1781 if ( avp->avp_rawdata != NULL ) { |
1782 /* the content was stored in rawdata */ | 1782 /* the content was stored in rawdata */ |
1783 memcpy(&buffer[*offset], avp->avp_rawdata, avp->avp_rawlen); | 1783 memcpy(&buffer[*offset], avp->avp_rawdata, avp->avp_rawlen); |
1784 *offset += PAD4(avp->avp_rawlen); | 1784 *offset += PAD4(avp->avp_rawlen); |
1785 } else { | 1785 } else if ( avp->avp_source != NULL ) { |
1786 /* the message was not parsed completely */ | 1786 /* the message was not parsed completely */ |
1787 size_t datalen = avp->avp_public.avp_len - GETAVPHDRSZ(avp->avp_public.avp_flags); | 1787 size_t datalen = avp->avp_public.avp_len - GETAVPHDRSZ(avp->avp_public.avp_flags); |
1788 memcpy(&buffer[*offset], avp->avp_source, datalen); | 1788 memcpy(&buffer[*offset], avp->avp_source, datalen); |
1789 *offset += PAD4(datalen); | 1789 *offset += PAD4(datalen); |
1790 } | 1790 } |