svn commit: samba r8404 - in branches/SAMBA_4_0/source/lib/appweb: esp mpr

tridge at samba.org tridge at samba.org
Wed Jul 13 00:43:18 GMT 2005


Author: tridge
Date: 2005-07-13 00:43:16 +0000 (Wed, 13 Jul 2005)
New Revision: 8404

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

Log:
small upstream merges of appweb code

Modified:
   branches/SAMBA_4_0/source/lib/appweb/esp/esp.c
   branches/SAMBA_4_0/source/lib/appweb/esp/espProcs.c
   branches/SAMBA_4_0/source/lib/appweb/mpr/miniMpr.h
   branches/SAMBA_4_0/source/lib/appweb/mpr/var.h


Changeset:
Modified: branches/SAMBA_4_0/source/lib/appweb/esp/esp.c
===================================================================
--- branches/SAMBA_4_0/source/lib/appweb/esp/esp.c	2005-07-13 00:43:00 UTC (rev 8403)
+++ branches/SAMBA_4_0/source/lib/appweb/esp/esp.c	2005-07-13 00:43:16 UTC (rev 8404)
@@ -1,7 +1,7 @@
 /*
  *	@file 	esp.c
  *	@brief 	Embedded Server Pages (ESP) core processing.
- *	@overview The ESP handler provides an efficient way to generate 
+ *	@overview Embedded Server Pages provides an efficient way to generate 
  *		dynamic pages using server-side Javascript. This code provides 
  *		core processing, and should be called by an associated web 
  *		server URL handler.
@@ -166,7 +166,7 @@
 	 *	Define variables as globals. headers[] are prefixed with "HTTP_".
  	 *	NOTE: MaRequest::setVar does not copy into globals, whereas espSetVar
 	 *	does if legacy_api is defined. So variables pre-defined by MaRequest 
- 	 *	must be copied here into globals[].
+ 	 *	must be copied here into globals[].
 	 *
 	 *	NOTE: if a variable is in session[] and in form[], the form[] will
 	 *	override being later in the variables[] list. Use mprSetProperty 
@@ -301,7 +301,7 @@
  */
 
 int espProcessRequest(EspRequest *ep, const char *docPath, char *docBuf, 
-					  char **errMsg)
+	char **errMsg)
 {
 	char	*jsBuf;
 
@@ -549,7 +549,7 @@
 			if (parse->token == 0) {
 				return ESP_TOK_ERR;
 			}
-			parse->token[parse->tokLen] = '\0';
+			parse->token[parse->tokLen] = '\0';
 			parse->tokp = &parse->token[parse->tokLen - 1];
 			parse->tokLen += ESP_TOK_INCR;
 			parse->endp = &parse->token[parse->tokLen - 1];
@@ -774,7 +774,7 @@
 				mprStrcpy(incPath, sizeof(incPath), parse.token);
 			} else {
 				mprGetDirName(dir, sizeof(dir), ep->uri);
-				mprSprintf(incPath, sizeof(incPath), "%s/%s",
+				mprSprintf(incPath, sizeof(incPath), "%s/%s", 
 					dir, parse.token);
 			}
 			if (esp->mapToStorage(ep->requestHandle, path, sizeof(path),
@@ -812,7 +812,7 @@
 	}
 	mprFree(parse.token);
 	if (len < 0) {
-		mprAllocSprintf(errMsg, MPR_MAX_STRING,
+		mprAllocSprintf(errMsg, MPR_MAX_STRING, 
 			"Script token is too big in %s.\nConfigured maximum is %d.", 
 			path, maxScriptSize);
 		return MPR_ERR_WONT_FIT;

Modified: branches/SAMBA_4_0/source/lib/appweb/esp/espProcs.c
===================================================================
--- branches/SAMBA_4_0/source/lib/appweb/esp/espProcs.c	2005-07-13 00:43:00 UTC (rev 8403)
+++ branches/SAMBA_4_0/source/lib/appweb/esp/espProcs.c	2005-07-13 00:43:16 UTC (rev 8404)
@@ -93,8 +93,11 @@
 		buf[size] = '\0';
 
 		extension = strrchr(argv[i], '.');
-		/* this makes handling include files in esp scripts much more convenient */
-		if (extension && strcasecmp(extension, ".esp") == 0) {
+
+		/*
+		 *	Allow nested inclusion of ESP requests
+		 */
+		if (extension && mprStrCmpAnyCase(extension, ".esp") == 0) {
 			if (espProcessRequest(ep, path, buf, &emsg) != 0) {
 				espError(ep, "Cant evaluate script - %s", emsg?emsg:"");
 				mprFree(buf);

Modified: branches/SAMBA_4_0/source/lib/appweb/mpr/miniMpr.h
===================================================================
--- branches/SAMBA_4_0/source/lib/appweb/mpr/miniMpr.h	2005-07-13 00:43:00 UTC (rev 8403)
+++ branches/SAMBA_4_0/source/lib/appweb/mpr/miniMpr.h	2005-07-13 00:43:16 UTC (rev 8404)
@@ -273,6 +273,8 @@
 extern void mprSetCtx(void *ctx);
 extern void *mprMemCtx(void);
 
+#define mprStrCmpAnyCase(s1, s2) StrCaseCmp(s1, s2)
+
 #ifdef __cplusplus
 }
 #endif

Modified: branches/SAMBA_4_0/source/lib/appweb/mpr/var.h
===================================================================
--- branches/SAMBA_4_0/source/lib/appweb/mpr/var.h	2005-07-13 00:43:00 UTC (rev 8403)
+++ branches/SAMBA_4_0/source/lib/appweb/mpr/var.h	2005-07-13 00:43:16 UTC (rev 8404)
@@ -156,10 +156,6 @@
 #define MPR_MAX_VAR				512
 #endif
 
-#ifndef __NO_PACK
-#pragma pack(2)
-#endif /* _NO_PACK */
-
 /*
  *	Function signatures
  */
@@ -348,11 +344,6 @@
 
 typedef BLD_FEATURE_NUM_TYPE MprNumber;
 
-
-#ifndef __NO_PACK
-#pragma pack()
-#endif /* __NO_PACK */
-
 /********************************* Prototypes *********************************/
 /*
  *	Variable constructors and destructors



More information about the samba-cvs mailing list