diff libfdproto/messages.c @ 892:b2e8f1a3ef76

Allow the content of the Failed-AVP to be parseable to bufferize the message. The content is only padded currently
author Sebastien Decugis <sdecugis@freediameter.net>
date Mon, 19 Nov 2012 08:58:40 +0100
parents 9432ac55823c
children 8187364e39ea
line wrap: on
line diff
--- a/libfdproto/messages.c	Sat Nov 17 23:28:50 2012 +0100
+++ b/libfdproto/messages.c	Mon Nov 19 08:58:40 2012 +0100
@@ -231,6 +231,14 @@
 		new->avp_public.avp_value = &new->avp_storage;
 	}
 	
+	if (flags & AVPFL_SET_RAWDATA_FROM_AVP) {
+		new->avp_rawlen = (*avp)->avp_public.avp_len - GETAVPHDRSZ( (*avp)->avp_public.avp_flags );
+		if (new->avp_rawlen) {
+			CHECK_MALLOC(  new->avp_rawdata = malloc(new->avp_rawlen)  );
+			memset(new->avp_rawdata, 0xFF, new->avp_rawlen);
+		}
+	}
+	
 	/* The new object is ready, return */
 	*avp = new;
 	return 0;
"Welcome to our mercurial repository"