Navigation


Changeset 1119:79dd22145f52 in freeDiameter for libfdproto/messages.c


Ignore:
Timestamp:
May 14, 2013, 12:04:20 PM (11 years ago)
Author:
Sebastien Decugis <sdecugis@freediameter.net>
Branch:
default
Phase:
public
Message:

Fix a number of compilation warnings

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libfdproto/messages.c

    r1113 r1119  
    921921       
    922922        if (!CHECK_MSG(msg)) {
    923                 CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "INVALID MESSAGE", msg), return NULL);
     923                CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "INVALID MESSAGE"), return NULL);
    924924                return *buf;
    925925        }
     
    955955        int success = 0;
    956956        struct dict_avp_data  dictdata;
    957         struct dict_vendor_data  vendordata;
    958         struct dict_vendor_data *vendorinfo = NULL;
    959        
    960957       
    961958        if (level) {
     
    11531150}
    11541151
    1155 #ifndef OLD_CODE_TO_BE_REPLACED
    1156 void fd_msg_dump_walk ( int level, msg_or_avp *obj )
    1157 {
    1158         LOG_D("fd_msg_dump_walk %d, %p is deprecated", level, obj);
    1159 }
    1160 void fd_msg_dump_one ( int level, msg_or_avp * obj )
    1161 {
    1162         LOG_D("fd_msg_dump_one %d, %p is deprecated", level, obj);
    1163 }
    1164 #endif
    11651152/***************************************************************************************************************/
    11661153/* Simple meta-data management */
     
    20582045               
    20592046                if (mandatory && (avp->avp_public.avp_flags & AVP_FLAG_MANDATORY)) {
    2060                         TRACE_DEBUG(INFO, "Unsupported mandatory AVP found:");
    2061                         fd_msg_dump_one(INFO, avp);
     2047                        TRACE_DEBUG(INFO, "Unsupported mandatory AVP found");
    20622048                        if (error_info) {
    20632049                                error_info->pei_errcode = "DIAMETER_AVP_UNSUPPORTED";
    20642050                                error_info->pei_avp = avp;
     2051                        } else {
     2052                                char * buf = NULL;
     2053                                size_t buflen;
     2054                                CHECK_MALLOC(fd_msg_dump_treeview(&buf, &buflen, NULL, avp, NULL, 0, 0));
     2055                                LOG_E("Unsupported AVP: %s", buf);
     2056                                free(buf);
    20652057                        }
    20662058                        return ENOTSUP;
     
    21022094        if ((avp_value_sizes[dictdata.avp_basetype] != 0) &&
    21032095            (avp->avp_public.avp_len - GETAVPHDRSZ( avp->avp_public.avp_flags ) != avp_value_sizes[dictdata.avp_basetype])) {
    2104                 TRACE_DEBUG(INFO, "The AVP size is not suitable for the type:");
    2105                 fd_msg_dump_one(INFO, avp);
     2096                TRACE_DEBUG(INFO, "The AVP size is not suitable for the type");
    21062097                if (error_info) {
    21072098                        error_info->pei_errcode = "DIAMETER_INVALID_AVP_LENGTH";
     
    21092100                        snprintf(error_message, sizeof(error_message), "I expected a size of %d for this AVP according to my dictionary", avp_value_sizes[dictdata.avp_basetype]);
    21102101                        error_info->pei_message = error_message;
     2102                } else {
     2103                        char * buf = NULL;
     2104                        size_t buflen;
     2105                        CHECK_MALLOC(fd_msg_dump_treeview(&buf, &buflen, NULL, avp, NULL, 0, 0));
     2106                        LOG_E("Invalid length AVP: %s", buf);
     2107                        free(buf);
    21112108                }
    21122109                avp->avp_model = NULL;
Note: See TracChangeset for help on using the changeset viewer.