[asterisk-commits] rizzo: trunk r45530 - /trunk/main/manager.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Wed Oct 18 05:55:13 MST 2006


Author: rizzo
Date: Wed Oct 18 07:55:12 2006
New Revision: 45530

URL: http://svn.digium.com/view/asterisk?rev=45530&view=rev
Log:
fix indentation from a commit of a couple of days ago


Modified:
    trunk/main/manager.c

Modified: trunk/main/manager.c
URL: http://svn.digium.com/view/asterisk/trunk/main/manager.c?rev=45530&r1=45529&r2=45530&view=diff
==============================================================================
--- trunk/main/manager.c (original)
+++ trunk/main/manager.c Wed Oct 18 07:55:12 2006
@@ -1918,42 +1918,41 @@
 		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");
+
+	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));
 			}
-			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;
-			}
-		}
+		}
+		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);



More information about the asterisk-commits mailing list