===================================================================
RCS file: /home/cvs/OpenXM/src/kan96xx/Doc/httpd.sm1,v
retrieving revision 1.2
retrieving revision 1.21
diff -u -p -r1.2 -r1.21
--- OpenXM/src/kan96xx/Doc/httpd.sm1 2001/08/23 00:49:00 1.2
+++ OpenXM/src/kan96xx/Doc/httpd.sm1 2012/12/23 01:27:54 1.21
@@ -1,7 +1,31 @@
-%% $OpenXM: OpenXM/src/kan96xx/Doc/httpd.sm1,v 1.1 2001/08/23 00:16:55 takayama Exp $
+%% $OpenXM: OpenXM/src/kan96xx/Doc/httpd.sm1,v 1.20 2010/02/08 01:08:39 takayama Exp $
%% common modules for httpd on sm1.
+% [(Strict) 1] system_variable % for debugging.
/Oxserver_history_variable (Oxserver_history_variable_) def
+/httpd.image.type
+ [(getenv) (OpenXM_PSTOIMG_TYPE)] extension
+def
+/httpd_sm1.cookie
+ [(oxGenPass)] extension
+def
+/httpd.set-cookie {
+ [(Set-Cookie: httpd_sm1=) httpd_sm1.cookie] cat
+} def
+
+
+[(getenv) (OXWEB_DEBUG)] extension tag 0 eq {
+ /httpd.debug 0 def
+} {
+ /httpd.debug 1 def
+} ifelse
+[(getenv) (OXWEB_TAKE_LOG)] extension tag 0 eq {
+ /httpd.take.log 0 def
+} {
+ /httpd.take.log 1 def
+} ifelse
+
+
/httpd_startserver {
[(sm1.socket) (open) [httpd.port (localhost)]] extension
/httpd.server.fdAndPort set
@@ -23,7 +47,7 @@
/sendln {
/arg1 set
- [/in-sendln /mmm] pushVariables
+ [/in-sendln /mmm /i] pushVariables
[ arg1 /mmm set
mmm tag 5 eq {
[mmm 10 (string) dc] cat /mmm set
@@ -33,7 +57,8 @@
[(sm1.socket) (select) [httpd.server.fd 0 get 0]] extension {
(Warning (sendln): your peer closed the connection. Do not send the data.) message
} {
- [(sm1.socket) (write) [httpd.server.fd 0 get mmm]] extension message
+ [(sm1.socket) (write) [httpd.server.fd 0 get mmm]] extension /i set
+ httpd.debug { i message } { } ifelse
} ifelse
] pop
popVariables
@@ -66,11 +91,13 @@
/httpd.serial 0 def
/httpd.history [ ] def
/httpd.result.history [ 0 ] def
+ [(nobody)] extension pop
{
httpd_startserver ;
httpd_action ;
httpd_stopserver ;
- (5 sleep) system
+ httpd.take.log { (date) system } { } ifelse
+% (sleep 2) system
httpd.serial 1 add /httpd.serial set
} loop
} def
@@ -89,7 +116,7 @@
0 sendln
() sendln
(Shutdown the engine.
) sendln
- (See you! Web/sm1 ) sendln
+ (See you! Web/asir, Web/sm1 ) sendln
() sendln
0 sendln
[(flush)] extension
@@ -116,6 +143,7 @@
(HTTP/0.9 200 OK) sendln
(Connection: close) sendln
(Content-Type: text/html) sendln
+ httpd.set-cookie sendln
0 sendln
%% (