Changeset 4614

Show
Ignore:
Timestamp:
02/14/07 01:40:10 (2 years ago)
Author:
morris
Message:

Get rid of checking, use debug logging instead

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • libwired/trunk/libwired/p7/wi-p7-message.c

    r4608 r4614  
    511511        field_id = wi_p7_spec_field_id(p7_message->spec, field_name); 
    512512         
    513         if(field_id == WI_P7_SPEC_FIELD_ID_NULL) { 
    514                 wi_p7_spec_log_warn(p7_message->spec, WI_STR("No id found for field \"%@\""), 
    515                         field_name); 
    516  
     513        if(field_id == WI_P7_SPEC_FIELD_ID_NULL) 
    517514                return false; 
    518         } 
    519515         
    520516        return _wi_p7_message_get_binary_buffer_for_reading_for_id(p7_message, field_id, 0, out_buffer, out_field_length); 
     
    528524        field_id = wi_p7_spec_field_id(p7_message->spec, field_name); 
    529525         
    530         if(field_id == WI_P7_SPEC_FIELD_ID_NULL) { 
    531                 wi_p7_spec_log_warn(p7_message->spec, WI_STR("No id found for field \"%@\""), 
    532                         field_name); 
    533  
     526        if(field_id == WI_P7_SPEC_FIELD_ID_NULL) 
    534527                return false; 
    535         } 
    536528         
    537529        if(length > 0) 
  • libwired/trunk/libwired/p7/wi-p7-private.h

    r4607 r4614  
    6363WI_EXPORT void                                          wi_p7_message_deserialize(wi_p7_message_t *); 
    6464 
    65 WI_EXPORT void                                          wi_p7_spec_log_warn(wi_p7_spec_t *, wi_string_t *, ...); 
    66 WI_EXPORT wi_boolean_t                          wi_p7_spec_is_checking(wi_p7_spec_t *); 
    67  
    6865WI_EXPORT wi_string_t *                         wi_p7_xml_string_for_attribute(xmlNodePtr, wi_string_t *); 
    6966WI_EXPORT wi_integer_t                          wi_p7_xml_integer_for_attribute(xmlNodePtr, wi_string_t *); 
  • libwired/trunk/libwired/p7/wi-p7-socket.c

    r4613 r4614  
    267267           wi_p7_message_set_enum_for_name(p7_message, 0, WI_STR("p7.handshake.compression")); 
    268268         
     269        wi_log_info(WI_STR("should set %u for encryption"), wi_p7_spec_enum_value(p7_socket->spec, 4, WI_STR("p7.handshake.encryption.rsa_aes_256"))); 
     270         
    269271        if(options & WI_P7_ENCRYPTION_RSA_AES) 
    270272                wi_p7_message_set_enum_for_name(p7_message, 0, WI_STR("p7.handshake.encryption")); 
     
    384386         
    385387        if(wi_p7_message_get_enum_for_name(p7_message, &encryption, WI_STR("p7.handshake.encryption"))) { 
     388                wi_log_info(WI_STR("should get %@ for %u"), wi_p7_spec_enum_name(p7_socket->spec, 4, encryption), encryption); 
     389 
    386390                if(encryption == 0 && options & WI_P7_ENCRYPTION_RSA_AES) 
    387391                        p7_socket->options |= WI_P7_ENCRYPTION_RSA_AES; 
     
    438442 
    439443static wi_boolean_t _wi_p7_socket_connect_key_exchange(wi_p7_socket_t *p7_socket, wi_time_interval_t timeout, wi_string_t *username_string, wi_string_t *password_string) { 
    440         wi_p7_message_t                *p7_message; 
    441         wi_data_t                              *data, *rsa_data; 
    442         wi_string_t                            *client_password_string1, *client_password_string2, *server_password_string; 
    443         unsigned char                  *cipher_key = NULL, *iv = NULL
    444         const unsigned char            *bytes
    445         void                                   *username = NULL, *server_password = NULL, *client_password = NULL
    446         uint32_t                               cipher_key_length, iv_length, username_length, client_password_length, server_password_length; 
     444        wi_p7_message_t         *p7_message; 
     445        wi_data_t                       *data, *rsa_data; 
     446        wi_string_t                     *client_password_string1, *client_password_string2, *server_password_string; 
     447        const void                     *bytes
     448        void                           *username = NULL, *server_password = NULL, *client_password = NULL, *cipher_key = NULL, *iv = NULL
     449        uint32_t                       username_length, client_password_length, server_password_length
     450        int32_t                                iv_length, cipher_key_length; 
    447451         
    448452        p7_message = wi_p7_socket_read_message(p7_socket, timeout); 
     
    491495 
    492496        if(EVP_SealInit(&p7_socket->cipher_ctx, 
    493                                         NULL, &cipher_key, 
     497                                        NULL, 
     498                                        (unsigned char **) &cipher_key, 
    494499                                        (int *) &cipher_key_length, 
    495                                         iv, 
    496                                         &p7_socket->public_key, 1) != 1) { 
     500                                        (unsigned char *) iv, 
     501                                        &p7_socket->public_key, 
     502                                        1) != 1) { 
    497503                ERR_print_errors_fp(stderr); 
    498504                 
     
    567573                goto end; 
    568574         
    569         server_password_string = wi_string_with_bytes((char *) server_password, server_password_length); 
     575        server_password_string = wi_string_with_bytes(server_password, server_password_length); 
    570576 
    571577        if(!wi_is_equal(server_password_string, client_password_string2)) { 
     
    599605 
    600606static wi_boolean_t _wi_p7_socket_accept_key_exchange(wi_p7_socket_t *p7_socket, wi_time_interval_t timeout) { 
    601         wi_p7_message_t                 *p7_message; 
    602         wi_data_t                               *data, *rsa_data, *cipher_key_data, *iv_data; 
    603         wi_string_t                             *string, *username_string, *client_password_string, *server_password_string1, *server_password_string2; 
    604         unsigned char                   *public_key = NULL; 
    605         void                                    *username = NULL, *client_password = NULL, *server_password; 
    606         uint32_t                                public_key_length, username_length, client_password_length, server_password_length; 
     607        wi_p7_message_t         *p7_message; 
     608        wi_data_t                       *data, *rsa_data, *cipher_key_data, *iv_data; 
     609        wi_string_t                     *string, *username_string, *client_password_string, *server_password_string1, *server_password_string2; 
     610        void                            *public_key = NULL, *username = NULL, *client_password = NULL, *server_password = NULL; 
     611        uint32_t                        public_key_length, username_length, client_password_length, server_password_length; 
    607612         
    608613        if(!p7_socket->private_key) { 
     
    612617        } 
    613618         
    614         public_key_length = i2d_RSA_PUBKEY(p7_socket->rsa_key, &public_key); 
     619        public_key_length = i2d_RSA_PUBKEY(p7_socket->rsa_key, (unsigned char **) &public_key); 
    615620         
    616621        if(public_key_length <= 0) { 
     
    836841        } 
    837842         
    838         p7_spec = wi_p7_spec_init_with_string(wi_p7_spec_alloc(), string, wi_p7_spec_is_checking(p7_socket->spec)); 
     843        p7_spec = wi_p7_spec_init_with_string(wi_p7_spec_alloc(), string); 
    839844         
    840845        if(!p7_spec) { 
  • libwired/trunk/libwired/p7/wi-p7-spec.c

    r4613 r4614  
    244244        wi_runtime_base_t                                               base; 
    245245         
    246         wi_boolean_t                                                    checking; 
    247          
    248246        wi_string_t                                                             *xml; 
    249247         
     
    261259static wi_string_t *                                            _wi_p7_spec_description(wi_runtime_instance_t *); 
    262260 
    263 static wi_boolean_t                                                     _wi_p7_spec_load_builtin(wi_p7_spec_t *, wi_boolean_t); 
    264 static wi_boolean_t                                                     _wi_p7_spec_load_file(wi_p7_spec_t *, wi_string_t *, wi_boolean_t); 
    265 static wi_boolean_t                                                     _wi_p7_spec_load_string(wi_p7_spec_t *, wi_string_t *, wi_boolean_t); 
     261static void                                                                     _wi_p7_spec_log_debug(wi_p7_spec_t *, wi_string_t *, ...); 
     262 
     263static wi_boolean_t                                                     _wi_p7_spec_load_builtin(wi_p7_spec_t *); 
     264static wi_boolean_t                                                     _wi_p7_spec_load_file(wi_p7_spec_t *, wi_string_t *); 
     265static wi_boolean_t                                                     _wi_p7_spec_load_string(wi_p7_spec_t *, wi_string_t *); 
    266266static wi_boolean_t                                                     _wi_p7_spec_load_spec(wi_p7_spec_t *, xmlDocPtr); 
    267267static wi_boolean_t                                                     _wi_p7_spec_load_types(wi_p7_spec_t *, xmlNodePtr); 
     
    468468        p7_spec->filename = wi_retain(WI_STR("(builtin)")); 
    469469 
    470         if(!_wi_p7_spec_load_builtin(p7_spec, true)) { 
     470        if(!_wi_p7_spec_load_builtin(p7_spec)) { 
    471471                wi_error_set_lib_error(WI_ERROR_P7_INVALIDSPEC); 
    472472                 
     
    481481 
    482482 
    483 wi_p7_spec_t * wi_p7_spec_init_with_file(wi_p7_spec_t *p7_spec, wi_string_t *path, wi_boolean_t checking) { 
     483wi_p7_spec_t * wi_p7_spec_init_with_file(wi_p7_spec_t *p7_spec, wi_string_t *path) { 
    484484        if(!_wi_p7_spec_builtin_spec) { 
    485485                _wi_p7_spec_builtin_spec = wi_p7_spec_init_builtin(wi_p7_spec_alloc()); 
     
    493493         
    494494        p7_spec = _wi_p7_spec_init(p7_spec); 
    495         p7_spec->checking = checking; 
    496495        p7_spec->filename = wi_retain(wi_string_last_path_component(path)); 
    497496         
    498         if(!_wi_p7_spec_load_file(p7_spec, path, checking)) { 
     497        if(!_wi_p7_spec_load_file(p7_spec, path)) { 
    499498                wi_error_set_lib_error(WI_ERROR_P7_INVALIDSPEC); 
    500499                 
     
    509508 
    510509 
    511 wi_p7_spec_t * wi_p7_spec_init_with_string(wi_p7_spec_t *p7_spec, wi_string_t *string, wi_boolean_t checking) { 
     510wi_p7_spec_t * wi_p7_spec_init_with_string(wi_p7_spec_t *p7_spec, wi_string_t *string) { 
    512511        if(!_wi_p7_spec_builtin_spec) { 
    513512                _wi_p7_spec_builtin_spec = wi_p7_spec_init_builtin(wi_p7_spec_alloc()); 
     
    522521        p7_spec = _wi_p7_spec_init(p7_spec); 
    523522         
    524         if(!_wi_p7_spec_load_string(p7_spec, string, checking)) { 
     523        if(!_wi_p7_spec_load_string(p7_spec, string)) { 
    525524                wi_error_set_lib_error(WI_ERROR_P7_INVALIDSPEC); 
    526525                 
     
    572571#pragma mark - 
    573572 
    574 static wi_boolean_t _wi_p7_spec_load_builtin(wi_p7_spec_t *p7_spec, wi_boolean_t checking) { 
     573static void _wi_p7_spec_log_debug(wi_p7_spec_t *p7_spec, wi_string_t *fmt, ...) { 
     574        wi_string_t             *string; 
     575        va_list                 ap; 
     576         
     577        if(wi_log_level >= WI_LOG_DEBUG) { 
     578                va_start(ap, fmt); 
     579                string = wi_string_init_with_format_and_arguments(wi_string_alloc(), fmt, ap); 
     580                va_end(ap); 
     581                 
     582                if(p7_spec->filename) 
     583                        wi_log_debug(WI_STR("%@: %@"), p7_spec->filename, string); 
     584                else 
     585                        wi_log_debug(WI_STR("%@"), string); 
     586        } 
     587
     588 
     589 
     590 
     591#pragma mark - 
     592 
     593static wi_boolean_t _wi_p7_spec_load_builtin(wi_p7_spec_t *p7_spec) { 
    575594        xmlDocPtr               doc; 
    576595         
     
    583602        } 
    584603         
    585         p7_spec->checking = checking; 
    586          
    587604        if(!_wi_p7_spec_load_spec(p7_spec, doc)) { 
    588605                xmlFreeDoc(doc); 
     
    598615 
    599616 
    600 static wi_boolean_t _wi_p7_spec_load_file(wi_p7_spec_t *p7_spec, wi_string_t *path, wi_boolean_t checking) { 
     617static wi_boolean_t _wi_p7_spec_load_file(wi_p7_spec_t *p7_spec, wi_string_t *path) { 
    601618        xmlDocPtr       doc; 
    602619        xmlChar         *buffer; 
     
    629646 
    630647 
    631 static wi_boolean_t _wi_p7_spec_load_string(wi_p7_spec_t *p7_spec, wi_string_t *string, wi_boolean_t checking) { 
     648static wi_boolean_t _wi_p7_spec_load_string(wi_p7_spec_t *p7_spec, wi_string_t *string) { 
    632649        xmlDocPtr       doc; 
    633650        xmlChar         *buffer; 
     
    641658                return false; 
    642659        } 
    643          
    644         p7_spec->checking = checking; 
    645660         
    646661        if(!_wi_p7_spec_load_spec(p7_spec, doc)) { 
     
    707722                        type = _wi_p7_spec_type_with_node(p7_spec, type_node); 
    708723                         
    709                         if(!type) { 
    710                                 if(p7_spec->checking) 
    711                                         return false; 
    712                                 else 
    713                                         continue; 
    714                         } 
    715                          
    716                         if(p7_spec->checking) { 
     724                        if(!type) 
     725                                return false; 
     726                         
     727                        if(wi_log_level >= WI_LOG_DEBUG) { 
    717728                                if(wi_hash_data_for_key(p7_spec->types_name, type->name)) { 
    718                                         wi_p7_spec_log_warn(p7_spec, WI_STR("Type with name \"%@\" already exists"), 
     729                                        _wi_p7_spec_log_debug(p7_spec, WI_STR("Type with name \"%@\" already exists"), 
    719730                                                type->name); 
    720731                                         
     
    723734 
    724735                                if(wi_hash_data_for_key(p7_spec->types_id, (void *) type->id)) { 
    725                                         wi_p7_spec_log_warn(p7_spec, WI_STR("Type with id %u (name \"%@\") already exists"), 
     736                                        _wi_p7_spec_log_debug(p7_spec, WI_STR("Type with id %u (name \"%@\") already exists"), 
    726737                                                type->name, type->id); 
    727738                                         
     
    748759                        field = _wi_p7_spec_field_with_node(p7_spec, field_node); 
    749760                         
    750                         if(!field) { 
    751                                 if(p7_spec->checking) 
    752                                         return false; 
    753                                 else 
    754                                         continue; 
    755                         } 
    756                          
    757                         if(p7_spec->checking) { 
     761                        if(!field) 
     762                                return false; 
     763                         
     764                        if(wi_log_level >= WI_LOG_DEBUG) { 
    758765                                if(wi_hash_data_for_key(p7_spec->fields_name, field->name)) { 
    759                                         wi_p7_spec_log_warn(p7_spec, WI_STR("Field with name \"%@\" already exists"), 
     766                                        _wi_p7_spec_log_debug(p7_spec, WI_STR("Field with name \"%@\" already exists"), 
    760767                                                field->name); 
    761768                                         
     
    764771                                 
    765772                                if(wi_hash_data_for_key(p7_spec->fields_id, (void *) field->id)) { 
    766                                         wi_p7_spec_log_warn(p7_spec, WI_STR("Field with id %u (name \"%@\") already exists"), 
     773                                        _wi_p7_spec_log_debug(p7_spec, WI_STR("Field with id %u (name \"%@\") already exists"), 
    767774                                                field->name, field->id); 
    768775                                         
     
    789796                        message = _wi_p7_spec_message_with_node(p7_spec, message_node); 
    790797                         
    791                         if(!message) { 
    792                                 if(p7_spec->checking) 
    793                                         return false; 
    794                                 else 
    795                                         continue; 
    796                         } 
    797                          
    798                         if(p7_spec->checking) { 
     798                        if(!message) 
     799                                return false; 
     800                         
     801                        if(wi_log_level >= WI_LOG_DEBUG) { 
    799802                                if(wi_hash_data_for_key(p7_spec->messages_name, message->name)) { 
    800                                         wi_p7_spec_log_warn(p7_spec, WI_STR("Message with name \"%@\" already exists"), 
     803                                        _wi_p7_spec_log_debug(p7_spec, WI_STR("Message with name \"%@\" already exists"), 
    801804                                                message->name); 
    802805                                         
     
    805808                                 
    806809                                if(wi_hash_data_for_key(p7_spec->messages_id, (void *) message->id)) { 
    807                                         wi_p7_spec_log_warn(p7_spec, WI_STR("Message with id %u (name \"%@\") already exists"), 
     810                                        _wi_p7_spec_log_debug(p7_spec, WI_STR("Message with id %u (name \"%@\") already exists"), 
    808811                                                message->id, message->name); 
    809812                                         
     
    830833                        transaction = _wi_p7_spec_transaction_with_node(p7_spec, transaction_node); 
    831834                         
    832                         if(!transaction) { 
    833                                 if(p7_spec->checking) 
    834                                         return false; 
    835                                 else 
    836                                         continue; 
    837                         } 
    838                          
    839                         if(p7_spec->checking) { 
     835                        if(!transaction) 
     836                                return false; 
     837                         
     838                        if(wi_log_level >= WI_LOG_DEBUG) { 
    840839                                if(wi_hash_data_for_key(p7_spec->transactions_name, transaction->message->name)) { 
    841                                         wi_p7_spec_log_warn(p7_spec, WI_STR("Transaction with message \"%@\" already exists"), 
     840                                        _wi_p7_spec_log_debug(p7_spec, WI_STR("Transaction with message \"%@\" already exists"), 
    842841                                                transaction->message->name); 
    843842                                         
     
    857856#pragma mark - 
    858857 
    859 void wi_p7_spec_log_warn(wi_p7_spec_t *p7_spec, wi_string_t *fmt, ...) { 
    860         wi_string_t             *string; 
    861         va_list                 ap; 
    862          
    863         if(p7_spec->checking) { 
    864                 va_start(ap, fmt); 
    865                 string = wi_string_init_with_format_and_arguments(wi_string_alloc(), fmt, ap); 
    866                 va_end(ap); 
    867                  
    868                 if(p7_spec->filename) 
    869                         wi_log_warn(WI_STR("%@: %@"), p7_spec->filename, string); 
    870                 else 
    871                         wi_log_warn(WI_STR("%@"), string); 
    872         } 
    873 } 
    874  
    875  
    876  
    877 #pragma mark - 
    878  
    879 wi_boolean_t wi_p7_spec_is_checking(wi_p7_spec_t *p7_spec) { 
    880         return p7_spec->checking; 
    881 } 
    882  
    883  
    884  
    885 #pragma mark - 
    886  
    887858wi_boolean_t wi_p7_spec_is_compatible_with_id(wi_p7_spec_t *p7_spec, wi_uuid_t *id) { 
    888859        return (wi_is_equal(p7_spec->id, id) || wi_set_contains_data(p7_spec->compatible_ids, id)); 
     
    928899                if(!other_transaction || !other_transaction->required) { 
    929900                        if(!other_transaction) { 
    930                                 wi_p7_spec_log_warn(p7_spec, WI_STR("Transaction \"%@\" is required, but peer lacks it"), 
     901                                _wi_p7_spec_log_debug(p7_spec, WI_STR("Transaction \"%@\" is required, but peer lacks it"), 
    931902                                        transaction->message->name); 
    932903                        } else { 
    933                                 wi_p7_spec_log_warn(p7_spec, WI_STR("Transaction \"%@\" is required, but peer has it optional"), 
     904                                _wi_p7_spec_log_debug(p7_spec, WI_STR("Transaction \"%@\" is required, but peer has it optional"), 
    934905                                        transaction->message->name); 
    935906                        } 
     
    944915                 
    945916                if(transaction->originator != other_transaction->originator) { 
    946                         wi_p7_spec_log_warn(p7_spec, WI_STR("Transaction \"%@\" should be sent by %@, but peer sends it by %@"), 
     917                        _wi_p7_spec_log_debug(p7_spec, WI_STR("Transaction \"%@\" should be sent by %@, but peer sends it by %@"), 
    947918                                transaction->message->name, 
    948919                                _wi_p7_spec_transaction_originator(transaction), 
     
    1003974         
    1004975        if(count != other_count) { 
    1005                 wi_p7_spec_log_warn(p7_spec, WI_STR("Transaction \"%@\" should have %u %@, but peer has %u"), 
     976                _wi_p7_spec_log_debug(p7_spec, WI_STR("Transaction \"%@\" should have %u %@, but peer has %u"), 
    1006977                        transaction->message->name, 
    1007978                        count, 
     
    1028999                if(!other_reply || !other_reply->required) { 
    10291000                        if(!other_reply) { 
    1030                                 wi_p7_spec_log_warn(p7_spec, WI_STR("Reply \"%@\" in transaction \"%@\" is required, but peer lacks it"), 
     1001                                _wi_p7_spec_log_debug(p7_spec, WI_STR("Reply \"%@\" in transaction \"%@\" is required, but peer lacks it"), 
    10311002                                        reply->message->name, transaction->message->name); 
    10321003                        } else { 
    1033                                 wi_p7_spec_log_warn(p7_spec, WI_STR("Reply \"%@\" in transaction \"%@\" is required, but peer has it optional"), 
     1004                                _wi_p7_spec_log_debug(p7_spec, WI_STR("Reply \"%@\" in transaction \"%@\" is required, but peer has it optional"), 
    10341005                                        reply->message->name, transaction->message->name); 
    10351006                        } 
     
    10411012        if(other_reply) { 
    10421013                if(reply->count != other_reply->count) { 
    1043                         wi_p7_spec_log_warn(p7_spec, WI_STR("Reply \"%@\" in transaction \"%@\" should be sent %u %@, but peer sends it %u %@"), 
     1014                        _wi_p7_spec_log_debug(p7_spec, WI_STR("Reply \"%@\" in transaction \"%@\" should be sent %u %@, but peer sends it %u %@"), 
    10441015                                reply->message->name, 
    10451016                                reply->count, 
     
    10711042         
    10721043        if(message->id != other_message->id) { 
    1073                 wi_p7_spec_log_warn(p7_spec, 
     1044                _wi_p7_spec_log_debug(p7_spec, 
    10741045                        WI_STR("Message in reply \"%@\" in transaction \"%@\" should have id %u, but peer has id %u"), 
    10751046                        message->name, transaction->message->name, message->id, other_message->id); 
     
    10871058                        if(!other_parameter || !other_parameter->required) { 
    10881059                                if(!other_parameter) { 
    1089                                         wi_p7_spec_log_warn(p7_spec, 
     1060                                        _wi_p7_spec_log_debug(p7_spec, 
    10901061                                                WI_STR("Parameter \"%@\" in reply \"%@\" in transaction \"%@\" is required, but peer lacks it"), 
    10911062                                                parameter->field->name, message->name, transaction->message->name); 
    10921063                                } else { 
    1093                                         wi_p7_spec_log_warn(p7_spec, 
     1064                                        _wi_p7_spec_log_debug(p7_spec, 
    10941065                                                WI_STR("Parameter \"%@\" in reply \"%@\" in transaction \"%@\" is required, but peer has it optional"), 
    10951066                                                parameter->field->name, message->name, transaction->message->name); 
     
    11051076                         
    11061077                        if(field->id != other_field->id) { 
    1107                                 wi_p7_spec_log_warn(p7_spec, 
     1078                                _wi_p7_spec_log_debug(p7_spec, 
    11081079                                        WI_STR("Field in parameter \"%@\" in reply \"%@\" in transaction \"%@\" should have id %u, but peer has id %u"), 
    11091080                                        parameter->field->name, message->name, transaction->message->name, field->id, other_field->id); 
     
    11131084                         
    11141085                        if(field->type->id != other_field->type->id) { 
    1115                                 wi_p7_spec_log_warn(p7_spec, 
     1086                                _wi_p7_spec_log_debug(p7_spec, 
    11161087                                        WI_STR("Parameter \"%@\" in reply \"%@\" in transaction \"%@\" should be of type \"%@\", but peer has it as \"%@\""), 
    11171088                                        parameter->field->name, message->name, transaction->message->name, field->type->name, other_field->type->name); 
     
    11221093                        if(field->type->id == WI_P7_ENUM) { 
    11231094                                if(!wi_is_equal(field->enums_name, other_field->enums_name)) { 
    1124                                         wi_p7_spec_log_warn(p7_spec, 
     1095                                        _wi_p7_spec_log_debug(p7_spec, 
    11251096                                                WI_STR("Parameter \"%@\" in reply \"%@\" in transaction \"%@\" have enumerations that differ with those of peer"), 
    11261097                                                parameter->field->name, message->name, transaction->message->name); 
     
    11591130                message = wi_hash_data_for_key(_wi_p7_spec_builtin_spec->messages_name, message_name); 
    11601131         
    1161         if(!message) 
     1132        if(!message) { 
     1133                _wi_p7_spec_log_debug(p7_spec, WI_STR("No id found for message \"%@\""), 
     1134                        message_name); 
     1135         
    11621136                return WI_P7_SPEC_MESSAGE_ID_NULL; 
     1137        } 
    11631138         
    11641139        return message->id; 
     
    11911166                field = wi_hash_data_for_key(_wi_p7_spec_builtin_spec->fields_name, field_name); 
    11921167 
    1193         if(!field) 
     1168        if(!field) { 
     1169                _wi_p7_spec_log_debug(p7_spec, WI_STR("No id found for field \"%@\""), 
     1170                        field_name); 
     1171 
    11941172                return WI_P7_SPEC_FIELD_ID_NULL; 
     1173        } 
    11951174         
    11961175        return field->id; 
     
    13201299         
    13211300        if(!type->name) { 
    1322                 wi_p7_spec_log_warn(p7_spec, WI_STR("Type has no \"name\"")); 
     1301                _wi_p7_spec_log_debug(p7_spec, WI_STR("Type has no \"name\"")); 
    13231302                 
    13241303                return NULL; 
     
    13281307         
    13291308        if(type->id == WI_P7_SPEC_TYPE_ID_NULL) { 
    1330                 wi_p7_spec_log_warn(p7_spec, WI_STR("Type \"%@\" has no \"id\""), 
     1309                _wi_p7_spec_log_debug(p7_spec, WI_STR("Type \"%@\" has no \"id\""), 
    13311310                        type->name); 
    13321311                 
     
    13881367 
    13891368        if(!field->name) { 
    1390                 wi_p7_spec_log_warn(p7_spec, WI_STR("Field has no \"name\"")); 
     1369                _wi_p7_spec_log_debug(p7_spec, WI_STR("Field has no \"name\"")); 
    13911370 
    13921371                return NULL; 
     
    13961375 
    13971376        if(!type) { 
    1398                 wi_p7_spec_log_warn(p7_spec, WI_STR("Field \"%@\" has no \"type\""), 
     1377                _wi_p7_spec_log_debug(p7_spec, WI_STR("Field \"%@\" has no \"type\""), 
    13991378                        field->name); 
    14001379 
     
    14081387         
    14091388        if(!field->type) { 
    1410                 wi_p7_spec_log_warn(p7_spec, WI_STR("Field \"%@\" has an invalid \"type\" (\"%@\")"), 
     1389                _wi_p7_spec_log_debug(p7_spec, WI_STR("Field \"%@\" has an invalid \"type\" (\"%@\")"), 
    14111390                        field->name, type); 
    14121391 
     
    14171396         
    14181397        if(field->id == WI_P7_SPEC_FIELD_ID_NULL) { 
    1419                 wi_p7_spec_log_warn(p7_spec, WI_STR("Field \"%@\" has no \"id\""), 
     1398                _wi_p7_spec_log_debug(p7_spec, WI_STR("Field \"%@\" has no \"id\""), 
    14201399                        field->name); 
    14211400 
     
    14321411                                 
    14331412                                if(!name) { 
    1434                                         wi_p7_spec_log_warn(p7_spec, WI_STR("Field \"%@\" enum has no \"name\""), 
     1413                                        _wi_p7_spec_log_debug(p7_spec, WI_STR("Field \"%@\" enum has no \"name\""), 
    14351414                                                field->name); 
    14361415                                         
     
    14871466 
    14881467        if(!message->name) { 
    1489                 wi_p7_spec_log_warn(p7_spec, WI_STR("Message has no name")); 
     1468                _wi_p7_spec_log_debug(p7_spec, WI_STR("Message has no name")); 
    14901469                 
    14911470                return NULL; 
     
    14951474         
    14961475        if(message->id == WI_P7_SPEC_MESSAGE_ID_NULL) { 
    1497                 wi_p7_spec_log_warn(p7_spec, WI_STR("Message \"%@\" has no \"id\""), 
     1476                _wi_p7_spec_log_debug(p7_spec, WI_STR("Message \"%@\" has no \"id\""), 
    14981477                        message->name); 
    14991478 
     
    15051484                        parameter = _wi_p7_spec_parameter_with_node(p7_spec, parameter_node, message); 
    15061485 
    1507                         if(!parameter) { 
    1508                                 if(p7_spec->checking) 
    1509                                         return NULL; 
    1510                                 else 
    1511                                         continue; 
    1512                         } 
    1513                          
    1514                         if(p7_spec->checking) { 
     1486                        if(!parameter) 
     1487                                return NULL; 
     1488                         
     1489                        if(wi_log_level >= WI_LOG_DEBUG) { 
    15151490                                if(wi_hash_data_for_key(message->parameters, parameter->field->name)) { 
    1516                                         wi_p7_spec_log_warn(p7_spec, WI_STR("Message \"%@\" has a duplicate field \"%@\""), 
     1491                                        _wi_p7_spec_log_debug(p7_spec, WI_STR("Message \"%@\" has a duplicate field \"%@\""), 
    15171492                                                message->name, parameter->field->name); 
    15181493                                         
     
    15621537 
    15631538        if(!field) { 
    1564                 wi_p7_spec_log_warn(p7_spec, WI_STR("Parameter in message \"%@\" has no \"field\""), 
     1539                _wi_p7_spec_log_debug(p7_spec, WI_STR("Parameter in message \"%@\" has no \"field\""), 
    15651540                        message->name); 
    15661541                 
     
    15741549         
    15751550        if(!parameter->field) { 
    1576                 wi_p7_spec_log_warn(p7_spec, WI_STR("Parameter in message \"%@\" has an invalid \"field\" (\"%@\")"), 
     1551                _wi_p7_spec_log_debug(p7_spec, WI_STR("Parameter in message \"%@\" has an invalid \"field\" (\"%@\")"), 
    15771552                        message->name, field); 
    15781553                 
     
    15831558 
    15841559        if(use) { 
    1585                 if(p7_spec->checking) { 
     1560                if(wi_log_level >= WI_LOG_DEBUG) { 
    15861561                        if(wi_string_case_insensitive_compare(use, WI_STR("required")) != 0 && 
    15871562                           wi_string_case_insensitive_compare(use, WI_STR("optional")) != 0) { 
    1588                                 wi_p7_spec_log_warn(p7_spec, WI_STR("Parameter \"%@\" in message \"%@\" has an invalid \"use\" (\"%@\")"), 
     1563                                _wi_p7_spec_log_debug(p7_spec, WI_STR("Parameter \"%@\" in message \"%@\" has an invalid \"use\" (\"%@\")"), 
    15891564                                        message->name, parameter->field->name, use); 
    15901565                                 
     
    16311606         
    16321607        if(!message) { 
    1633                 wi_p7_spec_log_warn(p7_spec, WI_STR("Transaction has no \"message\"")); 
     1608                _wi_p7_spec_log_debug(p7_spec, WI_STR("Transaction has no \"message\"")); 
    16341609                 
    16351610                return NULL; 
     
    16421617         
    16431618        if(!transaction->message) { 
    1644                 wi_p7_spec_log_warn(p7_spec, WI_STR("Transaction has an invalid \"message\" (\"%@\")"), 
     1619                _wi_p7_spec_log_debug(p7_spec, WI_STR("Transaction has an invalid \"message\" (\"%@\")"), 
    16451620                        message); 
    16461621                 
     
    16511626 
    16521627        if(!originator) { 
    1653                 wi_p7_spec_log_warn(p7_spec, WI_STR("Transaction \"%@\" has no \"originator\""), 
     1628                _wi_p7_spec_log_debug(p7_spec, WI_STR("Transaction \"%@\" has no \"originator\""), 
    16541629                        transaction->message->name); 
    16551630                 
     
    16571632        } 
    16581633 
    1659         if(p7_spec->checking) { 
     1634        if(wi_log_level >= WI_LOG_DEBUG) { 
    16601635                if(wi_string_case_insensitive_compare(originator, WI_STR("client")) != 0 && 
    16611636                   wi_string_case_insensitive_compare(originator, WI_STR("server")) != 0 && 
    16621637                   wi_string_case_insensitive_compare(originator, WI_STR("both")) != 0) { 
    1663                         wi_p7_spec_log_warn(p7_spec, WI_STR("Transaction \"%@\" has an invalid \"originator\" (\"%@\")"), 
     1638                        _wi_p7_spec_log_debug(p7_spec, WI_STR("Transaction \"%@\" has an invalid \"originator\" (\"%@\")"), 
    16641639                                transaction->message->name, originator); 
    16651640                         
     
    16781653 
    16791654        if(use) { 
    1680                 if(p7_spec->checking) { 
     1655                if(wi_log_level >= WI_LOG_DEBUG) { 
    16811656                        if(wi_string_case_insensitive_compare(use, WI_STR("required")) != 0 && 
    16821657                           wi_string_case_insensitive_compare(use, WI_STR("optional"))) { 
    1683                                 wi_p7_spec_log_warn(p7_spec, WI_STR("Transaction \"%@\" has an invalid \"use\" (\"%@\")"), 
     1658                                _wi_p7_spec_log_debug(p7_spec, WI_STR("Transaction \"%@\" has an invalid \"use\" (\"%@\")"), 
    16841659                                        transaction->message->name, use); 
    16851660                                 
     
    17531728                                reply = _wi_p7_spec_reply_with_node(p7_spec, andor_node, transaction); 
    17541729 
    1755                                 if(!reply) { 
    1756                                         if(p7_spec->checking) 
    1757                                                 return NULL; 
    1758                                         else 
    1759                                                 continue; 
    1760                                 } 
     1730                                if(!reply) 
     1731                                        return NULL; 
    17611732                                 
    1762                                 if(p7_spec->checking) { 
     1733                                if(wi_log_level >= WI_LOG_DEBUG) { 
    17631734                                        if(wi_hash_data_for_key(andor->replies_hash, reply->message->name)) { 
    1764                                                 wi_p7_spec_log_warn(p7_spec, WI_STR("Transaction \"%@\" has a duplicate reply \"%@\""), 
     1735                                                _wi_p7_spec_log_debug(p7_spec, WI_STR("Transaction \"%@\" has a duplicate reply \"%@\""), 
    17651736                                                        transaction->message->name, reply->message->name); 
    17661737                                                 
     
    18201791 
    18211792        if(!message) { 
    1822                 wi_p7_spec_log_warn(p7_spec, WI_STR("Reply in transaction \"%@\" has no \"message\""), 
     1793                _wi_p7_spec_log_debug(p7_spec, WI_STR("Reply in transaction \"%@\" has no \"message\""), 
    18231794                        transaction->message->name); 
    18241795                 
     
    18321803         
    18331804        if(!reply->message) { 
    1834                 wi_p7_spec_log_warn(p7_spec, WI_STR("Reply in transaction \"%@\" has an invalid \"message\" (\"%@\")"), 
     1805                _wi_p7_spec_log_debug(p7_spec, WI_STR("Reply in transaction \"%@\" has an invalid \"message\" (\"%@\")"), 
    18351806                        transaction->message->name, message); 
    18361807                 
     
    18411812 
    18421813        if(use) { 
    1843                 if(p7_spec->checking) { 
     1814                if(wi_log_level >= WI_LOG_DEBUG) { 
    18441815                        if(wi_string_case_insensitive_compare(use, WI_STR("required")) != 0 && 
    18451816                           wi_string_case_insensitive_compare(use, WI_STR("optional"))) { 
    1846                                 wi_p7_spec_log_warn(p7_spec, WI_STR("Reply \"%@\" in transaction \"%@\" has an invalid \"use\" (\"%@\")"), 
     1817                                _wi_p7_spec_log_debug(p7_spec, WI_STR("Reply \"%@\" in transaction \"%@\" has an invalid \"use\" (\"%@\")"), 
    18471818                                        reply->message->name, transaction->message->name, use); 
    18481819                         
  • libwired/trunk/libwired