mirror of https://github.com/yandex/odyssey.git
Reformat code
This commit is contained in:
parent
7b6fb2ded7
commit
99b1979ea5
|
@ -78,7 +78,7 @@ od_auth_frontend_cleartext(od_client_t *client)
|
||||||
if (client->rule->auth_query) {
|
if (client->rule->auth_query) {
|
||||||
rc = od_auth_query(client->global,
|
rc = od_auth_query(client->global,
|
||||||
client->rule,
|
client->rule,
|
||||||
client->io.io,
|
client->io.io,
|
||||||
&client->startup.user,
|
&client->startup.user,
|
||||||
&client_password);
|
&client_password);
|
||||||
if (rc == -1) {
|
if (rc == -1) {
|
||||||
|
@ -91,17 +91,17 @@ od_auth_frontend_cleartext(od_client_t *client)
|
||||||
machine_msg_free(msg);
|
machine_msg_free(msg);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if(client_password.password == NULL){
|
if(client_password.password == NULL){
|
||||||
char peer[128];
|
char peer[128];
|
||||||
od_getpeername(client->io.io, peer, sizeof(peer), 1, 0);
|
od_getpeername(client->io.io, peer, sizeof(peer), 1, 0);
|
||||||
od_log(&instance->logger, "auth", client, NULL,
|
od_log(&instance->logger, "auth", client, NULL,
|
||||||
"user '%s.%s' incorrect user from %s",
|
"user '%s.%s' incorrect user from %s",
|
||||||
client->startup.database.value,
|
client->startup.database.value,
|
||||||
client->startup.user.value,peer);
|
client->startup.user.value,peer);
|
||||||
od_frontend_error(client, KIWI_INVALID_PASSWORD,
|
od_frontend_error(client, KIWI_INVALID_PASSWORD,
|
||||||
"incorrect user");
|
"incorrect user");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
client_password.password_len = client->rule->password_len + 1;
|
client_password.password_len = client->rule->password_len + 1;
|
||||||
client_password.password = client->rule->password;
|
client_password.password = client->rule->password;
|
||||||
|
@ -191,7 +191,7 @@ od_auth_frontend_md5(od_client_t *client)
|
||||||
if (client->rule->auth_query) {
|
if (client->rule->auth_query) {
|
||||||
rc = od_auth_query(client->global,
|
rc = od_auth_query(client->global,
|
||||||
client->rule,
|
client->rule,
|
||||||
client->io.io,
|
client->io.io,
|
||||||
&client->startup.user,
|
&client->startup.user,
|
||||||
&query_password);
|
&query_password);
|
||||||
if (rc == -1) {
|
if (rc == -1) {
|
||||||
|
@ -204,17 +204,17 @@ od_auth_frontend_md5(od_client_t *client)
|
||||||
machine_msg_free(msg);
|
machine_msg_free(msg);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if(query_password.password == NULL){
|
if(query_password.password == NULL){
|
||||||
char peer[128];
|
char peer[128];
|
||||||
od_getpeername(client->io.io, peer, sizeof(peer), 1, 0);
|
od_getpeername(client->io.io, peer, sizeof(peer), 1, 0);
|
||||||
od_log(&instance->logger, "auth", client, NULL,
|
od_log(&instance->logger, "auth", client, NULL,
|
||||||
"user '%s.%s' incorrect user from %s",
|
"user '%s.%s' incorrect user from %s",
|
||||||
client->startup.database.value,
|
client->startup.database.value,
|
||||||
client->startup.user.value,peer);
|
client->startup.user.value,peer);
|
||||||
od_frontend_error(client, KIWI_INVALID_PASSWORD,
|
od_frontend_error(client, KIWI_INVALID_PASSWORD,
|
||||||
"incorrect user");
|
"incorrect user");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
query_password.password_len--;
|
query_password.password_len--;
|
||||||
} else {
|
} else {
|
||||||
query_password.password_len = client->rule->password_len;
|
query_password.password_len = client->rule->password_len;
|
||||||
|
|
|
@ -158,13 +158,13 @@ od_auth_query_format(od_rule_t *rule, kiwi_var_t *user,
|
||||||
len = od_snprintf(dst_pos, dst_end - dst_pos, "%s",
|
len = od_snprintf(dst_pos, dst_end - dst_pos, "%s",
|
||||||
user->value);
|
user->value);
|
||||||
dst_pos += len;
|
dst_pos += len;
|
||||||
} else if (*format_pos == 'h') {
|
} else if (*format_pos == 'h') {
|
||||||
int len;
|
int len;
|
||||||
char peer[128];
|
char peer[128];
|
||||||
od_getpeername(io, peer, sizeof(peer), 1, 0);
|
od_getpeername(io, peer, sizeof(peer), 1, 0);
|
||||||
len = od_snprintf(dst_pos, dst_end - dst_pos, "%s",
|
len = od_snprintf(dst_pos, dst_end - dst_pos, "%s",
|
||||||
peer);
|
peer);
|
||||||
dst_pos += len; } else {
|
dst_pos += len; } else {
|
||||||
if (od_unlikely((dst_end - dst_pos) < 2))
|
if (od_unlikely((dst_end - dst_pos) < 2))
|
||||||
break;
|
break;
|
||||||
dst_pos[0] = '%';
|
dst_pos[0] = '%';
|
||||||
|
|
Loading…
Reference in New Issue