From: Luigi Rizzo Date: Wed, 18 Oct 2006 12:55:12 +0000 (+0000) Subject: fix indentation from a commit of a couple of days ago X-Git-Tag: 1.6.0-beta1~3^2~4360 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=becfe17739f2cf9ed0ec7e3c13457fe4cf107a74;p=thirdparty%2Fasterisk.git 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 --- diff --git a/main/manager.c b/main/manager.c index d43f36b94e..40b3ca0ab1 100644 --- a/main/manager.c +++ b/main/manager.c @@ -1918,42 +1918,41 @@ static int process_message(struct mansession *s, struct message *m) astman_send_error(s, m, "Missing action in request"); return 0; } - if (!ast_strlen_zero(id)) { + if (!ast_strlen_zero(id)) snprintf(idText, sizeof(idText), "ActionID: %s\r\n", id); - } - if (!strcasecmp(action, "Challenge")) { - char *authtype = astman_get_header(m, "AuthType"); - - if (!strcasecmp(authtype, "MD5")) { - if (ast_strlen_zero(s->challenge)) - snprintf(s->challenge, sizeof(s->challenge), "%ld", ast_random()); - ast_mutex_lock(&s->__lock); - astman_append(s, "Response: Success\r\n" - "%s" - "Challenge: %s\r\n\r\n", - idText, s->challenge); - ast_mutex_unlock(&s->__lock); - } else { - astman_send_error(s, m, "Must specify AuthType"); - } - return 0; - } else if (!strcasecmp(action, "Login")) { - if (authenticate(s, m)) { - sleep(1); - astman_send_error(s, m, "Authentication failed"); - return -1; - } else { - s->authenticated = 1; - if (option_verbose > 1) { - 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_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; + + if (!strcasecmp(action, "Challenge")) { + char *authtype = astman_get_header(m, "AuthType"); + + if (!strcasecmp(authtype, "MD5")) { + if (ast_strlen_zero(s->challenge)) + snprintf(s->challenge, sizeof(s->challenge), "%ld", ast_random()); + ast_mutex_lock(&s->__lock); + astman_append(s, "Response: Success\r\n" + "%s" + "Challenge: %s\r\n\r\n", + idText, s->challenge); + ast_mutex_unlock(&s->__lock); + } else { + astman_send_error(s, m, "Must specify AuthType"); + } + return 0; + } else if (!strcasecmp(action, "Login")) { + if (authenticate(s, m)) { + sleep(1); + astman_send_error(s, m, "Authentication failed"); + return -1; + } + s->authenticated = 1; + if (option_verbose > 1) { + 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_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; ast_mutex_lock(&s->__lock);