You are viewing a plain text version of this content. The canonical link for it is here.
Posted to websh-cvs@tcl.apache.org by da...@apache.org on 2002/04/17 13:27:38 UTC
cvs commit: tcl-websh/src/generic cfg.c filecounter.c mod_websh.c request.h request_ap.c webout.c
davidw 02/04/17 04:27:38
Modified: src/generic cfg.c filecounter.c mod_websh.c request.h
request_ap.c webout.c
Log:
* generic/request_ap.c: Added requestScriptName accessor.
Revision Changes Path
1.10 +20 -4 tcl-websh/src/generic/cfg.c
Index: cfg.c
===================================================================
RCS file: /home/cvs/tcl-websh/src/generic/cfg.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- cfg.c 9 Apr 2002 15:38:31 -0000 1.9
+++ cfg.c 17 Apr 2002 11:27:37 -0000 1.10
@@ -9,7 +9,7 @@
* See the file "license.terms" for information on usage and
* redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * @(#) $Id: cfg.c,v 1.9 2002/04/09 15:38:31 ronnie Exp $
+ * @(#) $Id: cfg.c,v 1.10 2002/04/17 11:27:37 davidw Exp $
* ------------------------------------------------------------------------- */
#include <tcl.h>
@@ -119,7 +119,8 @@
{
/* keep consistent with enum PutxMarkup in request.h */
- static char *putxMarkups[] = { "brace",
+ static char *putxMarkups[] = {
+ "brace",
"tag",
NULL
};
@@ -136,6 +137,10 @@
"copyright",
"cmdurltimestamp",
"reset",
+ "script",
+ "server_root",
+ "document_root",
+ "interpclass",
NULL
};
@@ -151,7 +156,11 @@
WEBSHVERSION,
WEBSHCOPYRIGHT,
CMDURLTIMESTAMP,
- RESET
+ RESET,
+ SCRIPT,
+ SERVER_ROOT,
+ DOCUMENT_ROOT,
+ INTERPCLASS
};
@@ -398,7 +407,7 @@
Tcl_AppendResult(interp,
"Copyright (c) 1996-2000 by Netcetera AG, http://netcetera.ch\n",
"Copyright (c) 2001-2002 by Apache Software Foundation\n",
- "For license and information details, see http://websh.com\n",
+ "For license and information details, see http://tcl.apache.org/websh/\n",
"Send comments and requests for help to info@websh.com",
NULL);
return TCL_OK;
@@ -449,6 +458,13 @@
Tcl_SetBooleanObj(cfgData->requestData->cmdUrlTimestamp, 1);
+ return TCL_OK;
+ }
+ case SCRIPT: {
+ char *scriptname;
+ WebAssertObjc(objc != 2, 2, NULL);
+ requestScriptName(interp, &scriptname);
+ Tcl_SetResult(interp, scriptname, NULL);
return TCL_OK;
}
default:
1.5 +7 -7 tcl-websh/src/generic/filecounter.c
Index: filecounter.c
===================================================================
RCS file: /home/cvs/tcl-websh/src/generic/filecounter.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- filecounter.c 7 Mar 2002 10:56:28 -0000 1.4
+++ filecounter.c 17 Apr 2002 11:27:37 -0000 1.5
@@ -1,7 +1,7 @@
/* ----------------------------------------------------------------------------
- * filecounter.c ---
+ * filecounter.c ---
* nca-073-9
- *
+ *
* Copyright (c) 1996-2000 by Netcetera AG.
* Copyright (c) 2001 by Apache Software Foundation.
* All rights reserved.
@@ -9,7 +9,7 @@
* See the file "license.terms" for information on usage and
* redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * @(#) $Id: filecounter.c,v 1.4 2002/03/07 10:56:28 ronnie Exp $
+ * @(#) $Id: filecounter.c,v 1.5 2002/04/17 11:27:37 davidw Exp $
* ------------------------------------------------------------------------- */
#include "filecounter.h"
@@ -157,16 +157,16 @@
int objc, Tcl_Obj * CONST objv[])
{
- Tcl_Obj *hnameobj, *fnameobj, *seedobj, *maxobj,
- *minobj, *incrobj, *maskobj, *wrapobj;
+ Tcl_Obj *hnameobj, *fnameobj, *seedobj, *maxobj,
+ *minobj, *incrobj, *maskobj, *wrapobj;
SeqNoGenerator *seqnogen = NULL;
Tcl_Obj *result = NULL;
Tcl_CmdInfo cmdInfo;
static char *params[] = { "-filename", "-seed", "-min", "-max",
- "-incr", "-perms", "-wrap", NULL
+ "-incr", "-perms", "-wrap", NULL
};
enum params
- { FILENAME, SEED, MIN, MAX, INCR, MASK, WRAP };
+ { FILENAME, SEED, MIN, MAX, INCR, MASK, WRAP };
int idx;
/* ----------------------------------------------------------------------
1.12 +3 -4 tcl-websh/src/generic/mod_websh.c
Index: mod_websh.c
===================================================================
RCS file: /home/cvs/tcl-websh/src/generic/mod_websh.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- mod_websh.c 9 Apr 2002 14:31:16 -0000 1.11
+++ mod_websh.c 17 Apr 2002 11:27:37 -0000 1.12
@@ -9,7 +9,7 @@
* See the file "license.terms" for information on usage and
* redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * @(#) $Id: mod_websh.c,v 1.11 2002/04/09 14:31:16 ronnie Exp $
+ * @(#) $Id: mod_websh.c,v 1.12 2002/04/17 11:27:37 davidw Exp $
* ------------------------------------------------------------------------- */
/* ====================================================================
@@ -385,15 +385,14 @@
/* ---------------------------------------------------------------------
* ready to rumble
* --------------------------------------------------------------------- */
-
if (!run_websh_script(r)) {
-
#ifndef APACHE2
ap_log_rerror(APLOG_MARK, APLOG_ERR, r,
#else /* APACHE2 */
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO | APLOG_ERR, 0, r,
#endif /* APACHE2 */
- "couldn't run websh script: %s", r->filename);
+ "couldn't run websh script: %s",
+ r->filename);
return HTTP_INTERNAL_SERVER_ERROR;
}
1.7 +5 -3 tcl-websh/src/generic/request.h
Index: request.h
===================================================================
RCS file: /home/cvs/tcl-websh/src/generic/request.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- request.h 27 Feb 2002 10:14:33 -0000 1.6
+++ request.h 17 Apr 2002 11:27:37 -0000 1.7
@@ -1,7 +1,7 @@
/*
* request.h --- websh3 request data processing
* nca-073-9
- *
+ *
* Copyright (c) 1996-2000 by Netcetera AG.
* Copyright (c) 2001 by Apache Software Foundation.
* All rights reserved.
@@ -9,7 +9,7 @@
* See the file "license.terms" for information on usage and
* redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * @(#) $Id: request.h,v 1.6 2002/02/27 10:14:33 davidw Exp $
+ * @(#) $Id: request.h,v 1.7 2002/04/17 11:27:37 davidw Exp $
*
*/
@@ -184,11 +184,13 @@
long *bytesSkipped);
char *mimeGetParameterFromContDisp(const char *contentDisp, const char *name);
-/* in CGI case: implemented in request_cgi.c
+/* in CGI case: implemented in request_cgi.c
* in httpd case: implemented in mod_websh.c */
Tcl_Obj *requestGetDefaultChannelName();
char *requestGetDefaultOutChannelName();
int requestFillRequestValues(Tcl_Interp * interp, RequestData * requestData);
+
+int requestScriptName(Tcl_Interp *interp, char **filename);
#endif
1.9 +8 -1 tcl-websh/src/generic/request_ap.c
Index: request_ap.c
===================================================================
RCS file: /home/cvs/tcl-websh/src/generic/request_ap.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- request_ap.c 5 Mar 2002 16:11:10 -0000 1.8
+++ request_ap.c 17 Apr 2002 11:27:37 -0000 1.9
@@ -9,7 +9,7 @@
* See the file "license.terms" for information on usage and
* redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * @(#) $Id: request_ap.c,v 1.8 2002/03/05 16:11:10 ronnie Exp $
+ * @(#) $Id: request_ap.c,v 1.9 2002/04/17 11:27:37 davidw Exp $
*
*/
@@ -92,5 +92,12 @@
paramListSetAsWhole(requestData->request, "GATEWAY_INTERFACE",
Tcl_NewStringObj("CGI-websh/1.1", -1));
+ return TCL_OK;
+}
+
+int requestScriptName(Tcl_Interp *interp, char **filename) {
+ request_rec *r;
+ r = (request_rec *)Tcl_GetAssocData(interp, WEB_AP_ASSOC_DATA, NULL);
+ *filename = ap_pstrdup(r->pool, r->filename);
return TCL_OK;
}
1.8 +3 -2 tcl-websh/src/generic/webout.c
Index: webout.c
===================================================================
RCS file: /home/cvs/tcl-websh/src/generic/webout.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- webout.c 5 Mar 2002 15:02:11 -0000 1.7
+++ webout.c 17 Apr 2002 11:27:37 -0000 1.8
@@ -9,7 +9,7 @@
* See the file "license.terms" for information on usage and
* redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * @(#) $Id: webout.c,v 1.7 2002/03/05 15:02:11 ronnie Exp $
+ * @(#) $Id: webout.c,v 1.8 2002/04/17 11:27:37 davidw Exp $
*
*/
@@ -345,8 +345,9 @@
}
outData->defaultResponseObj = responseObj;
Tcl_ResetResult(interp); /* empty string */
- if (old->name != NULL)
+ if (old->name != NULL) {
Tcl_SetObjResult(interp, old->name);
+ }
return TCL_OK;
break;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: websh-cvs-unsubscribe@tcl.apache.org
For additional commands, e-mail: websh-cvs-help@tcl.apache.org