fix indentation from a commit of a couple of days ago

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@45530 65c4cc65-6c06-0410-ace0-fbb531ad65f3
1.6.0
Luigi Rizzo 19 years ago
parent 8e63fb21da
commit becfe17739

@ -1918,42 +1918,41 @@ static int process_message(struct mansession *s, struct message *m)
astman_send_error(s, m, "Missing action in request"); astman_send_error(s, m, "Missing action in request");
return 0; return 0;
} }
if (!ast_strlen_zero(id)) { if (!ast_strlen_zero(id))
snprintf(idText, sizeof(idText), "ActionID: %s\r\n", id); snprintf(idText, sizeof(idText), "ActionID: %s\r\n", id);
}
if (!strcasecmp(action, "Challenge")) { if (!strcasecmp(action, "Challenge")) {
char *authtype = astman_get_header(m, "AuthType"); char *authtype = astman_get_header(m, "AuthType");
if (!strcasecmp(authtype, "MD5")) { if (!strcasecmp(authtype, "MD5")) {
if (ast_strlen_zero(s->challenge)) if (ast_strlen_zero(s->challenge))
snprintf(s->challenge, sizeof(s->challenge), "%ld", ast_random()); snprintf(s->challenge, sizeof(s->challenge), "%ld", ast_random());
ast_mutex_lock(&s->__lock); ast_mutex_lock(&s->__lock);
astman_append(s, "Response: Success\r\n" astman_append(s, "Response: Success\r\n"
"%s" "%s"
"Challenge: %s\r\n\r\n", "Challenge: %s\r\n\r\n",
idText, s->challenge); idText, s->challenge);
ast_mutex_unlock(&s->__lock); ast_mutex_unlock(&s->__lock);
} else { } else {
astman_send_error(s, m, "Must specify AuthType"); astman_send_error(s, m, "Must specify AuthType");
} }
return 0; return 0;
} else if (!strcasecmp(action, "Login")) { } else if (!strcasecmp(action, "Login")) {
if (authenticate(s, m)) { if (authenticate(s, m)) {
sleep(1); sleep(1);
astman_send_error(s, m, "Authentication failed"); astman_send_error(s, m, "Authentication failed");
return -1; return -1;
} else { }
s->authenticated = 1; s->authenticated = 1;
if (option_verbose > 1) { if (option_verbose > 1) {
if (displayconnects) { if (displayconnects) {
ast_verbose(VERBOSE_PREFIX_2 "%sManager '%s' logged on from %s\n", (s->sessiontimeout ? "HTTP " : ""), s->username, ast_inet_ntoa(s->sin.sin_addr)); ast_verbose(VERBOSE_PREFIX_2 "%sManager '%s' logged on from %s\n", (s->sessiontimeout ? "HTTP " : ""), s->username, ast_inet_ntoa(s->sin.sin_addr));
}
}
ast_log(LOG_EVENT, "%sManager '%s' logged on from %s\n", (s->sessiontimeout ? "HTTP " : ""), s->username, ast_inet_ntoa(s->sin.sin_addr));
astman_send_ack(s, m, "Authentication accepted");
return 0;
} }
} }
ast_log(LOG_EVENT, "%sManager '%s' logged on from %s\n", (s->sessiontimeout ? "HTTP " : ""), s->username, ast_inet_ntoa(s->sin.sin_addr));
astman_send_ack(s, m, "Authentication accepted");
return 0;
}
{ {
struct manager_action *tmp; struct manager_action *tmp;
ast_mutex_lock(&s->__lock); ast_mutex_lock(&s->__lock);

Loading…
Cancel
Save