changeset 304:a9eb3f7fc273

Be less defensive in _mpd_do_avp about the number of times we were called
author Sebastien Decugis <sdecugis@nict.go.jp>
date Thu, 08 Jan 2009 14:19:10 +0900
parents b2902fc18fef
children 02071f609de5
files waaad/message.c
diffstat 1 files changed, 4 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/waaad/message.c	Thu Jan 08 14:14:27 2009 +0900
+++ b/waaad/message.c	Thu Jan 08 14:19:10 2009 +0900
@@ -966,13 +966,9 @@
 			return ENOTSUP;
 		}
 		
-		if (recheck) {
-			/* In this case, the data is supposed to be in the raw internal buffer */
-			CHECK_PARAMS(  avp->avp_rawdata  );
-			TRACE_DEBUG(FULL, "Unsupported optional AVP found, raw source data is stored in avp_rawdata...");
-		} else {
+		if (avp->avp_source) {
 			/* we must copy the data from the source to the internal buffer area */
-			CHECK_PARAMS(  avp->avp_source && !avp->avp_rawdata  );
+			CHECK_PARAMS( !avp->avp_rawdata  );
 			
 			CHECK_MALLOC(  avp->avp_rawdata = malloc(avp->avp_public.avp_len - GETAVPHDRSZ( avp->avp_public.avp_flags ))  );
 			
@@ -982,6 +978,8 @@
 			TRACE_DEBUG(FULL, "Unsupported optional AVP found, raw source data saved in avp_rawdata.");
 		}
 		
+		CHECK_PARAMS(  avp->avp_rawdata  );
+		
 		return 0;
 	}
 	
"Welcome to our mercurial repository"