[asterisk-commits] anthonyl: branch anthonyl/8509-manager-httcallback r48286 - /team/anthonyl/85...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Tue Dec 5 17:20:44 MST 2006


Author: anthonyl
Date: Tue Dec  5 18:20:44 2006
New Revision: 48286

URL: http://svn.digium.com/view/asterisk?view=rev&rev=48286
Log:
there is no code path in this function where it is possible to have ret above 0

Modified:
    team/anthonyl/8509-manager-httcallback/main/manager.c

Modified: team/anthonyl/8509-manager-httcallback/main/manager.c
URL: http://svn.digium.com/view/asterisk/team/anthonyl/8509-manager-httcallback/main/manager.c?view=diff&rev=48286&r1=48285&r2=48286
==============================================================================
--- team/anthonyl/8509-manager-httcallback/main/manager.c (original)
+++ team/anthonyl/8509-manager-httcallback/main/manager.c Tue Dec  5 18:20:44 2006
@@ -1926,7 +1926,6 @@
 
 	ast_copy_string(action, astman_get_header(m, "Action"), sizeof(action));
 	ast_log( LOG_DEBUG, "Manager received command '%s'\n", action );
-	ast_verbose("manager command '%s' \n", action); /* same as above for quick testing */
 	
 	if (ast_strlen_zero(action)) {
 		astman_send_error(s, m, "Missing action in request");
@@ -1935,13 +1934,7 @@
 	if (!ast_strlen_zero(id)) {
 		snprintf(idText, sizeof(idText), "ActionID: %s\r\n", id);
 	}
-
-	/* it seems the problem in the issue is that we want to re-autencate
-	   but the mansession_id is still the same so. when we pass a login 
-	   message it's not processed in the below block of code
-	   
-	   and is just returned as a unknown command 
-	*/
+	
 	if (!s->authenticated) {
 		if (!strcasecmp(action, "Challenge")) {
 			char *authtype;
@@ -1961,6 +1954,11 @@
 				return 0;
 			}
 		} else if (!strcasecmp(action, "Login")) {
+			
+			/* in case of re-authencation of an existing session (it happens) remove write/read perms */
+			s->readperm = 0;   
+		        s->writeperm = 0;
+			 
 			if (authenticate(s, m)) {
 				sleep(1);
 				astman_send_error(s, m, "Authentication failed");
@@ -1980,9 +1978,7 @@
 			return -1;
 		} else
 			astman_send_error(s, m, "Authentication Required");
-	} else {
 		while (tmp) { 	
-			ast_verbose("your are  authencted so you are here\n");
 			if (!strcasecmp(action, tmp->action)) {
 				if ((s->writeperm & tmp->authority) == tmp->authority) {
 					if (tmp->func(s, m))
@@ -1996,9 +1992,7 @@
 		}
 		if (!tmp)
 			astman_send_error(s, m, "Invalid/unknown command");
-	}
-	if (ret)
-		return ret;
+	
 	return process_events(s);
 }
 



More information about the asterisk-commits mailing list