Changeset 974:2091bf698fb1 in freeDiameter for extensions/app_acct
- Timestamp:
- Mar 15, 2013, 2:14:35 AM (11 years ago)
- Branch:
- default
- Phase:
- public
- Location:
- extensions/app_acct
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/app_acct/acct_conf.l
r741 r974 81 81 if (ret != 1) { 82 82 /* No matching: an error occurred */ 83 fd_log_debug("Unable to convert the value '%s' to a valid number: %s \n", yytext, strerror(errno));83 fd_log_debug("Unable to convert the value '%s' to a valid number: %s", yytext, strerror(errno)); 84 84 return LEX_ERROR; /* trig an error in yacc parser */ 85 85 /* Maybe we could REJECT instead of failing here? */ … … 93 93 yylval->string = strdup(yytext+1); 94 94 if (!yylval->string) { 95 fd_log_debug("Unable to copy the string '%s': %s \n", yytext, strerror(errno));95 fd_log_debug("Unable to copy the string '%s': %s", yytext, strerror(errno)); 96 96 TRACE_DEBUG(INFO, "strdup failed"); 97 97 return LEX_ERROR; /* trig an error in yacc parser */ … … 137 137 /* Unrecognized sequence, if it did not match any previous pattern */ 138 138 [^[:space:]"*=>;\n]+ { 139 fd_log_debug("Unrecognized text on line %d col %d: '%s'. \n", yylloc->first_line, yylloc->first_column, yytext);139 fd_log_debug("Unrecognized text on line %d col %d: '%s'.", yylloc->first_line, yylloc->first_column, yytext); 140 140 return LEX_ERROR; 141 141 } -
extensions/app_acct/acct_conf.y
r808 r974 83 83 84 84 if ( ! acct_config->conninfo) { 85 fd_log_debug("[app_acct] ERROR: 'ConnInfo' is missing in file '%s'. \n"85 fd_log_debug("[app_acct] ERROR: 'ConnInfo' is missing in file '%s'." 86 86 " You can specify 'ConnInfo=\"\";' to use default parameters.\n", conffile); 87 87 return EINVAL; 88 88 } 89 89 if ( ! acct_config->tablename) { 90 fd_log_debug("[app_acct] ERROR: 'Table' value is missing in file '%s'. \n", conffile);90 fd_log_debug("[app_acct] ERROR: 'Table' value is missing in file '%s'.", conffile); 91 91 return EINVAL; 92 92 } … … 97 97 struct fd_list * li; 98 98 99 fd_log_debug("[app_acct] Configuration dump: \n");100 fd_log_debug(" Database: \n");101 fd_log_debug(" ConnInfo ...... : '%s' \n", acct_config->conninfo ?: "<null>");102 fd_log_debug(" Table name .... : '%s' \n", acct_config->tablename ?: "<null>");103 fd_log_debug(" Timestamp field : '%s' \n", acct_config->tsfield ?: "<null>");104 fd_log_debug(" Server name fld : '%s' \n", acct_config->srvnfield ?: "<null>");105 fd_log_debug(" AVPs that will be saved to the database: \n");99 fd_log_debug("[app_acct] Configuration dump:"); 100 fd_log_debug(" Database:"); 101 fd_log_debug(" ConnInfo ...... : '%s'", acct_config->conninfo ?: "<null>"); 102 fd_log_debug(" Table name .... : '%s'", acct_config->tablename ?: "<null>"); 103 fd_log_debug(" Timestamp field : '%s'", acct_config->tsfield ?: "<null>"); 104 fd_log_debug(" Server name fld : '%s'", acct_config->srvnfield ?: "<null>"); 105 fd_log_debug(" AVPs that will be saved to the database:"); 106 106 for (li = acct_config->avps.next; li != &acct_config->avps; li = li->next) { 107 107 struct acct_conf_avp * a = (struct acct_conf_avp *)li; … … 112 112 fd_log_debug("field '%s' ", a->field?:a->avpname); 113 113 } 114 fd_log_debug("as ::%s \n", diam2db_types_mapping[a->avptype]);115 } 116 fd_log_debug("[app_acct] Complete. \n");114 fd_log_debug("as ::%s", diam2db_types_mapping[a->avptype]); 115 } 116 fd_log_debug("[app_acct] Complete."); 117 117 return 0; 118 118 } … … 158 158 if (acct_confin == NULL) { 159 159 ret = errno; 160 fd_log_debug("Unable to open extension configuration file %s for reading: %s \n", conffile, strerror(ret));160 fd_log_debug("Unable to open extension configuration file %s for reading: %s", conffile, strerror(ret)); 161 161 return ret; 162 162 } … … 180 180 181 181 if (ploc->first_line != ploc->last_line) 182 fd_log_debug("%s:%d.%d-%d.%d : %s \n", conffile, ploc->first_line, ploc->first_column, ploc->last_line, ploc->last_column, s);182 fd_log_debug("%s:%d.%d-%d.%d : %s", conffile, ploc->first_line, ploc->first_column, ploc->last_line, ploc->last_column, s); 183 183 else if (ploc->first_column != ploc->last_column) 184 fd_log_debug("%s:%d.%d-%d : %s \n", conffile, ploc->first_line, ploc->first_column, ploc->last_column, s);184 fd_log_debug("%s:%d.%d-%d : %s", conffile, ploc->first_line, ploc->first_column, ploc->last_column, s); 185 185 else 186 fd_log_debug("%s:%d.%d : %s \n", conffile, ploc->first_line, ploc->first_column, s);186 fd_log_debug("%s:%d.%d : %s", conffile, ploc->first_line, ploc->first_column, s); 187 187 } 188 188 -
extensions/app_acct/acct_db.c
r871 r974 79 79 80 80 CHECK_PARAMS_DO( PQisthreadsafe() == 1, { 81 fd_log_debug("You PostGreSQL installation is not thread-safe! \n");81 fd_log_debug("You PostGreSQL installation is not thread-safe!"); 82 82 return EINVAL; 83 83 } ); … … 88 88 /* Check to see that the backend connection was successfully made */ 89 89 if (PQstatus(conn) != CONNECTION_OK) { 90 fd_log_debug("Connection to database failed: %s \n", PQerrorMessage(conn));90 fd_log_debug("Connection to database failed: %s", PQerrorMessage(conn)); 91 91 acct_db_free(); 92 92 return EINVAL; 93 93 } 94 94 if (PQprotocolVersion(conn) < 3) { 95 fd_log_debug("Database protocol version is too old, version 3 is required for prepared statements. \n");95 fd_log_debug("Database protocol version is too old, version 3 is required for prepared statements."); 96 96 acct_db_free(); 97 97 return EINVAL; … … 194 194 ADD_EXTEND(");"); 195 195 196 TRACE_DEBUG(FULL, "Preparing the following SQL statement: \n%s\n", sql);196 TRACE_DEBUG(FULL, "Preparing the following SQL statement: '%s'", sql); 197 197 res = PQprepare(conn, stmt, sql, emptyrecords.nball, NULL); 198 198 if (PQresultStatus(res) != PGRES_COMMAND_OK) { -
extensions/app_acct/acct_records.c
r741 r974 126 126 /* Check at least one AVP was mapped */ 127 127 if (records->nball == records->nbunmap) { 128 fd_log_debug("The received ACR does not contain any AVP from the configuration file. \n"128 fd_log_debug("The received ACR does not contain any AVP from the configuration file." 129 129 "This is an invalid situation. Please fix your configuration file.\n" 130 130 "One way to ensure this does not happen is to include Session-Id in the database.\n"); … … 137 137 struct acct_record_item * r = (struct acct_record_item *)(li->o); 138 138 if (r->param->required && (r->index <= 1)) { 139 fd_log_debug("The received ACR does not contain the required AVP '%s'. \n", r->param->avpname);139 fd_log_debug("The received ACR does not contain the required AVP '%s'.", r->param->avpname); 140 140 acct_rec_empty(records); 141 141 return EINVAL;
Note: See TracChangeset
for help on using the changeset viewer.