svn commit: samba r7000 - in branches/SAMBA_4_0/source/web_server: .

tridge at samba.org tridge at samba.org
Fri May 27 00:43:24 GMT 2005


Author: tridge
Date: 2005-05-27 00:43:24 +0000 (Fri, 27 May 2005)
New Revision: 7000

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=7000

Log:
only keep session data if not empty - this saves us using lots of memory needlessly

Modified:
   branches/SAMBA_4_0/source/web_server/http.c


Changeset:
Modified: branches/SAMBA_4_0/source/web_server/http.c
===================================================================
--- branches/SAMBA_4_0/source/web_server/http.c	2005-05-27 00:31:41 UTC (rev 6999)
+++ branches/SAMBA_4_0/source/web_server/http.c	2005-05-27 00:43:24 UTC (rev 7000)
@@ -780,13 +780,19 @@
 		talloc_free(web->session->data);
 		web->session->data = talloc_zero(web->session, struct MprVar);
 		mprSetCtx(web->session->data);
-		mprCopyVar(web->session->data, &esp->variables[ESP_SESSION_OBJ], MPR_DEEP_COPY);
-
-		/* setup the timeout for the session data */
-		talloc_free(web->session->te);
-		web->session->te = event_add_timed(web->conn->event.ctx, web->session, 
-						   timeval_current_ofs(web->session->lifetime, 0), 
-						   session_timeout, web->session);
+		if (esp->variables[ESP_SESSION_OBJ].properties == NULL ||
+		    esp->variables[ESP_SESSION_OBJ].properties[0].numItems == 0) {
+			talloc_free(web->session);
+			web->session = NULL;
+		} else {
+			mprCopyVar(web->session->data, &esp->variables[ESP_SESSION_OBJ], 
+				   MPR_DEEP_COPY);
+			/* setup the timeout for the session data */
+			talloc_free(web->session->te);
+			web->session->te = event_add_timed(web->conn->event.ctx, web->session, 
+							   timeval_current_ofs(web->session->lifetime, 0), 
+							   session_timeout, web->session);
+		}
 	}
 
 	talloc_free(esp);



More information about the samba-cvs mailing list