TT#33319 Convert tabs to spaces in code style

Change-Id: Ifeabbb0ab740a3ca39b147cd40b5e6e726082bb5
changes/05/19405/1
Andreas Granig 7 years ago
parent dd75641cc9
commit 0a40eb2af0

@ -236,8 +236,8 @@ int main(int argc, char **argv)
maprefresh = 0;
batches = malloc(sizeof(*batches));
if (!batches) {
L_ERROR("Out of memory allocating batches");
return -1;
L_ERROR("Out of memory allocating batches");
return -1;
}
while(!mediator_shutdown)

@ -433,23 +433,23 @@ int medmysql_insert_records(med_entry_t *records, uint64_t count, const char *ta
int ret;
if (!count)
return 0;
return 0;
sql_buffer = (char*)malloc(sql_buffer_size);
if (!sql_buffer) {
L_ERROR("Failed to allocate memory for redis cleanup sql buffer\n");
return -1;
L_ERROR("Failed to allocate memory for redis cleanup sql buffer\n");
return -1;
}
memset(sql_buffer, 0, sql_buffer_size);
snprintf(sql_buffer, sql_buffer_size, "INSERT INTO kamailio.acc_%s " \
"(sip_code,sip_reason,method,callid,time,time_hires,src_leg,dst_leg) VALUES ",
table);
"(sip_code,sip_reason,method,callid,time,time_hires,src_leg,dst_leg) VALUES ",
table);
for (uint64_t i = 0; i < count; ++i) {
med_entry_t *e = &(records[i]);
snprintf(entry_buffer, sizeof(entry_buffer), "('%s','%s','%s','%s','%s','%f','%s','%s'),",
e->sip_code, e->sip_reason, e->sip_method, e->callid, e->timestamp, e->unix_timestamp, e->src_leg, e->dst_leg);
e->sip_code, e->sip_reason, e->sip_method, e->callid, e->timestamp, e->unix_timestamp, e->src_leg, e->dst_leg);
sql_buffer = strcat(sql_buffer, entry_buffer);
}
sql_buffer[strlen(sql_buffer)-1] = '\0';

@ -696,11 +696,11 @@ static int medredis_cleanup_entries(med_entry_t *records, uint64_t count, const
char buffer[512];
if (medmysql_insert_records(records, count, table) != 0) {
L_CRITICAL("Failed to cleanup redis records\n");
goto err;
L_CRITICAL("Failed to cleanup redis records\n");
goto err;
}
for (uint64_t i = 0; i < count; ++i) {
for (uint64_t i = 0; i < count; ++i) {
med_entry_t *e = &(records[i]);
L_DEBUG("Cleaning up redis entry for %s:%f\n", e->callid, e->unix_timestamp);
@ -710,8 +710,8 @@ static int medredis_cleanup_entries(med_entry_t *records, uint64_t count, const
argv[0] = "DEL";
argv[1] = buffer;
if (medredis_append_command_argv(con, 2, argv, 1) != 0) {
L_ERROR("Failed to append redis command to remove key '%s'\n", buffer);
goto err;
L_ERROR("Failed to append redis command to remove key '%s'\n", buffer);
goto err;
}
// delete cid from acc:meth::INVITE and acc:meth::BYE
@ -720,21 +720,21 @@ static int medredis_cleanup_entries(med_entry_t *records, uint64_t count, const
snprintf(buffer, sizeof(buffer), "acc:entry::%s:%f", e->callid, e->unix_timestamp);
argv[2] = buffer;
if (medredis_append_command_argv(con, 3, argv, 1) != 0) {
L_ERROR("Failed to append redis command to remove key '%s' from '%s'\n", buffer, argv[1]);
goto err;
L_ERROR("Failed to append redis command to remove key '%s' from '%s'\n", buffer, argv[1]);
goto err;
}
argv[1] = "acc:meth::BYE";
if (medredis_append_command_argv(con, 3, argv, 1) != 0) {
L_ERROR("Failed to append redis command to remove key '%s' from '%s'\n", buffer, argv[1]);
goto err;
L_ERROR("Failed to append redis command to remove key '%s' from '%s'\n", buffer, argv[1]);
goto err;
}
// delete acc:entry::$cid:$timestamp
argv[0] = "DEL";
argv[1] = buffer;
if (medredis_append_command_argv(con, 2, argv, 1) != 0) {
L_ERROR("Failed to append redis command to remove key '%s'\n", buffer);
goto err;
if (medredis_append_command_argv(con, 2, argv, 1) != 0) {
L_ERROR("Failed to append redis command to remove key '%s'\n", buffer);
goto err;
}
}

Loading…
Cancel
Save