[BACK]Return to httpd.sm1 CVS log [TXT][DIR] Up to [local] / OpenXM / src / kan96xx / Doc

Diff for /OpenXM/src/kan96xx/Doc/httpd.sm1 between version 1.15 and 1.19

version 1.15, 2002/11/10 07:00:03 version 1.19, 2005/11/21 12:46:49
Line 1 
Line 1 
 %% $OpenXM: OpenXM/src/kan96xx/Doc/httpdsm1,v 1.14 2002/11/09 12:42:25 takayama Exp $  %% $OpenXM: OpenXM/src/kan96xx/Doc/httpd.sm1,v 1.18 2005/11/21 09:12:22 takayama Exp $
 %% common modules for httpd on sm1.  %% common modules for httpd on sm1.
   % [(Strict) 1] system_variable  % for debugging.
 /Oxserver_history_variable (Oxserver_history_variable_) def  /Oxserver_history_variable (Oxserver_history_variable_) def
 /httpd.image.type  /httpd.image.type
   [(getenv) (OpenXM_PSTOIMG_TYPE)] extension    [(getenv) (OpenXM_PSTOIMG_TYPE)] extension
 def  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 {  [(getenv) (OXWEB_DEBUG)] extension tag 0 eq {
    /httpd.debug 0 def     /httpd.debug 0 def
 } {  } {
Line 134  def
Line 143  def
    (HTTP/0.9 200 OK) sendln     (HTTP/0.9 200 OK) sendln
    (Connection: close) sendln     (Connection: close) sendln
    (Content-Type: text/html) sendln     (Content-Type: text/html) sendln
      httpd.set-cookie sendln
    0 sendln     0 sendln
 %%   (<FORM NAME="myFORM" METHOD="POST">) sendln  %%   (<FORM NAME="myFORM" METHOD="POST">) sendln
    result sendln     result sendln
Line 287  def
Line 297  def
  } ifelse   } ifelse
   
   
 %% Decompose into tokens separated by a space.  
 %% (GET /hoge.jpeg ???) ---> [(GET) (/hoge.jpeg) (???)]  
 /toTokensBySpace {  
   /arg1 set  
   [/in-toTokesBySpace /ss /ss2 /i] pushVariables  
   [  
     /ss arg1 def  
     ss 1 copy /ss set  
     ss (array) dc /ss2 set  
     0 1 ss2 length 1 sub {  
       /i set  
       ss2 i get 32 eq { %% equal to space  
         ss i (,) put  
       } {  } ifelse  
     } for  
     httpd.debug { ss message } {  } ifelse  
     [ ss to_records pop] /arg1 set  
   ] pop  
   popVariables  
   arg1  
 } def  
   
 /askToSendFile {  /askToSendFile {
   /arg1 set    /arg1 set
Line 454  def
Line 443  def
   [/in-preformatHTML /sss /c] pushVariables    [/in-preformatHTML /sss /c] pushVariables
   [    [
      /sss arg1 def       /sss arg1 def
        sss toString /sss set
      sss (array) dc /sss set       sss (array) dc /sss set
      sss {       sss {
        /c set         /c set
Line 762  def
Line 752  def
   [/in-httpd_type /fname /ftype /i /ans] pushVariables    [/in-httpd_type /fname /ftype /i /ans] pushVariables
   [    [
     /fname arg1 def      /fname arg1 def
     fname (array) dc /fname set      fname getFileType /ftype set
     fname reverse /fname set  
     [      /ans (text/plain) def  % .txt, .jar,
      0 1 fname length 1 sub {  
        /i set  
        fname i get 46 eq {   % '.'  
          exit  
        } { fname i get } ifelse  
      } for  
     ] /ftype set  
     ftype reverse {(string) dc} map cat /ftype set  
     /ans (text/plain) def  
     ftype (gif) eq {      ftype (gif) eq {
       /ans (image/gif) def        /ans (image/gif) def
     }{ } ifelse      }{ } ifelse
Line 789  def
Line 770  def
     ftype (html) eq ftype (htm) eq or {      ftype (html) eq ftype (htm) eq or {
       /ans (text/html) def        /ans (text/html) def
     } {  } ifelse      } {  } ifelse
     ftype (txt) eq {      ftype (wav) eq {
       /ans (text/html) def        /ans (audio/x-wav) def
     } {  } ifelse      } { } ifelse
       ftype (class) eq {
         /ans (application/octet-stream) def
       } { } ifelse
     /arg1 ans def      /arg1 ans def
   ] pop    ] pop
   popVariables    popVariables
Line 824  def
Line 808  def
  ] pop   ] pop
  popVariables   popVariables
  arg1   arg1
   } def
   
   /httpd.startBrowserUnix {
     /arg1 set
     [/portnum /browser /cmd /fd /msg /htmlfn] pushVariables
     [
        arg1 /portnum set
        portnum toString /portnum set
        [(getenv) (OX_BROWSER)]  extension /browser set
        {
         browser tag 0 eq {
           [(sleep 3 ; netscape http://localhost:) portnum ( & ) ] cat
           /cmd set cmd message
           cmd system
           exit
          }{ } ifelse
          browser (mac) eq, browser (MAC) eq, or {
            (.sm1.httpd.startBrowserUnix.html) /htmlfn set
            htmlfn (w) file /fd set
            fd tag 0 eq { (httpd.startBrowserUnix fails to open a file.) error }
            { } ifelse
            [(<html><body>) nl
             (<a href="http://localhost:) portnum (">)
             (Click here to connect to the ox server)
             (</a>) nl
             (</body></html>) nl
            ] cat /msg set
            fd msg writestring  fd closefile
            [(sleep 3 ; open ) htmlfn ( &) ] cat
            /cmd set cmd message
            cmd system
            exit
          }{ } ifelse
          [(sleep 3 ; ) browser ( http://localhost:) portnum ( & ) ] cat
          /cmd set cmd message
          cmd system
          exit
        } loop
     ] pop
     popVariables
 } def  } def
   

Legend:
Removed from v.1.15  
changed lines
  Added in v.1.19

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>