[asterisk-commits] pari: branch 1.4 r99007 - /branches/1.4/main/manager.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Jan 17 17:09:53 CST 2008


Author: pari
Date: Thu Jan 17 17:09:53 2008
New Revision: 99007

URL: http://svn.digium.com/view/asterisk?view=rev&rev=99007
Log:
reverting 99001 - We need the Max-Age for extending the life of cookie  mansession_id

Modified:
    branches/1.4/main/manager.c

Modified: branches/1.4/main/manager.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/main/manager.c?view=diff&rev=99007&r1=99006&r2=99007
==============================================================================
--- branches/1.4/main/manager.c (original)
+++ branches/1.4/main/manager.c Thu Jan 17 17:09:53 2008
@@ -2639,7 +2639,6 @@
 	char *c = workspace;
 	char *retval = NULL;
 	struct ast_variable *v;
-	unsigned int new_session = 0;
 
 	for (v = params; v; v = v->next) {
 		if (!strcasecmp(v->name, "mansession_id")) {
@@ -2671,7 +2670,6 @@
 		ast_atomic_fetchadd_int(&s->eventq->usecount, 1);
 		ast_atomic_fetchadd_int(&num_sessions, 1);
 		AST_LIST_UNLOCK(&sessions);
-		new_session = 1;
 	}
 
 	/* Reset HTTP timeout.  If we're not yet authenticated, keep it extremely short */
@@ -2712,10 +2710,8 @@
 			s->needdestroy = 1;
 		}
 		ast_build_string(&c, &len, "Content-type: text/%s\r\n", contenttype[format]);
-		if (new_session) {
-			sprintf(tmp, "%08lx", s->managerid);
-			ast_build_string(&c, &len, "%s\r\n", ast_http_setcookie("mansession_id", tmp, httptimeout, cookie, sizeof(cookie)));
-		}
+		sprintf(tmp, "%08lx", s->managerid);
+		ast_build_string(&c, &len, "%s", ast_http_setcookie("mansession_id", tmp, httptimeout, cookie, sizeof(cookie)));
 		if (format == FORMAT_HTML)
 			ast_build_string(&c, &len, "<title>Asterisk&trade; Manager Interface</title>");
 		if (format == FORMAT_XML) {




More information about the asterisk-commits mailing list