=================================================================== RCS file: /home/cvs/OpenXM/src/kan96xx/Doc/httpd.sm1,v retrieving revision 1.4 retrieving revision 1.10 diff -u -p -r1.4 -r1.10 --- OpenXM/src/kan96xx/Doc/httpd.sm1 2001/08/29 11:18:57 1.4 +++ OpenXM/src/kan96xx/Doc/httpd.sm1 2002/10/23 13:38:50 1.10 @@ -1,4 +1,4 @@ -%% $OpenXM: OpenXM/src/kan96xx/Doc/httpd.sm1,v 1.3 2001/08/23 02:08:41 takayama Exp $ +%% $OpenXM: OpenXM/src/kan96xx/Doc/httpd.sm1,v 1.9 2002/10/21 10:43:52 takayama Exp $ %% common modules for httpd on sm1. /Oxserver_history_variable (Oxserver_history_variable_) def /httpd.image.type @@ -74,7 +74,7 @@ def httpd_startserver ; httpd_action ; httpd_stopserver ; - (5 sleep) system +% (sleep 2) system httpd.serial 1 add /httpd.serial set } loop } def @@ -93,7 +93,7 @@ def 0 sendln () sendln (Shutdown the engine.
) sendln - (See you! Web/sm1 ) sendln + (See you! Web/asir, Web/sm1 ) sendln () sendln 0 sendln [(flush)] extension @@ -127,7 +127,11 @@ def %%( ) sendln %%test. It does not work always?! %%( Pretty format ) sendln %%test. It works. - (
) sendln + [(getenv) (OXWEB_POST)] extension tag 0 eq { + () sendln % use get + }{ + () sendln + } ifelse () sendln [()] cat sendln @@ -178,6 +182,17 @@ def [(flush)] extension } def +/send-page-warning-image { + (HTTP/0.9 200 OK) sendln + (Connection: close) sendln + (Content-Type: text/html) sendln + 0 sendln + (Error: Image translation is not supported on this server
) sendln + ( Check the value of the environmental variable OpenXM_PSTOIMG_TYPE
) sendln + 0 sendln + [(flush)] extension +} def + /stopclient { [(sm1.socket) (close) [client.fdAndPort 0 get] ] extension message } def @@ -307,29 +322,41 @@ def arg1 } def -%% remove GET /?msg= +%% remove GET /?msg= or msg= /removeGET { /arg1 set [/in-removeGET /s /s2 /i /j /i0 - /tname + /tname /nnn ] pushVariables [ /s arg1 def - /httpd.textarea.valid 1 def + /httpd.textarea.valid 0 def s 1 copy /s2 set s (array) dc /s set + /nnn httpd.textarea.name.aaa length 6 sub def /tname [ ] def 0 1 s length 1 sub { /i0 set s i0 get 61 eq { %% 61 is = i0 1 add /i0 set - tname message + + [ + << tname length 1 sub >> -1 + << tname length nnn sub >> dup 0 ge { } { pop 0 } ifelse + { + /i set + tname i get + } for + ] reverse /tname set + (GET /?) (array) dc tname join /tname set + httpd.textarea.name.aaa message tname httpd.textarea.name.aaa eq { /httpd.textarea.valid 1 def } { /httpd.textarea.valid 0 def + httpd.textarea.name.aaa { (string) dc } map cat message (Warning: got an invalid name for the text field.) message } ifelse exit @@ -341,6 +368,8 @@ def i0 1 s length 1 sub { /i set s2 j << s i get (string) dc >> put + j s2 length 1 sub lt { s2 j 1 add ( ) put } { } ifelse + %% might cause a BUG. It should be improved. j 1 add /j set } for /arg1 s2 def