OSDN Git Service

Ver.1.4.7: Fix bugs. Add proc time measurement code.
authorwatanaby <>
Sat, 18 Nov 2006 08:35:36 +0000 (08:35 +0000)
committerwatanaby <>
Sat, 18 Nov 2006 08:35:36 +0000 (08:35 +0000)
25 files changed:
opengate/conf/opengatesrv.conf.sample
opengate/conf/rc.firewall.sample
opengate/doc/Changes.html
opengate/javahtml/en/accept-http.html
opengate/javahtml/en/accept-java.html
opengate/javahtml/en/accept-time.html
opengate/javahtml/en/httpkeep.html
opengate/javahtml/en/index-ssl.html
opengate/javahtml/en/index.html
opengate/javahtml/ja/accept-http.html
opengate/javahtml/ja/accept-java.html
opengate/javahtml/ja/accept-time.html
opengate/javahtml/ja/accept2.html
opengate/javahtml/ja/httpkeep.html
opengate/javahtml/ja/index-ssl.html
opengate/javahtml/ja/index.html
opengate/javahtml/ja/topindex.html
opengate/opengatesrv/Makefile
opengate/opengatesrv/comm-cgi.c
opengate/opengatesrv/ctrl-firewall.c
opengate/opengatesrv/get-param.c
opengate/opengatesrv/htmltemplate.c
opengate/opengatesrv/main.c
opengate/opengatesrv/test-cgi.c
opengate/opengatesrv/watch-client.c

index 73abe2b..775246c 100644 (file)
@@ -1,5 +1,5 @@
 <?xml version="1.0"?>
-<Opengate version="1.4.5">
+<Opengate ConfigVersion="1.4.7">
 
 <!-- ################################################# 
 #    ####### NEED TO MODIFY FOLLOWING PARAMETERS #####  -->
@@ -70,7 +70,7 @@
        <JavaWatch>
                <!-- HTTP_USER_AGENT ignoring java watch mode -->
                <!-- defined by "POSIX Extended Regular Expression" -->
-               <SkipAgentPattern></SkipAgentPattern>
+               <SkipAgentPattern>^$</SkipAgentPattern>
        </JavaWatch>
 
        <!-- IPFW rule number range used by opengate -->
index 4b1cdcb..29decc2 100644 (file)
@@ -38,6 +38,8 @@ $fwcmd add pass tcp from any 53 to any
 
 ### Forwarding http connection from unauth client 
 $fwcmd add 60000 fwd localhost tcp from ${inet}:${imask} to any 80
+$fwcmd add 60000 fwd localhost tcp from ${inet}:${imask} to any 443
+
 
 ### Allow TCP through if setup succeeded 
 $fwcmd add 60100 pass tcp from any to any established
index 1d3eff3..02762e8 100644 (file)
@@ -513,6 +513,11 @@ Ver.1.4.6 at 2006.11.11</DT>
 <DD>\r
 Change dir mode to install properly. Add mac check. Fix small bugs. \r
 </DD>\r
+<DT>\r
+Ver.1.4.7 at 2006.11.18</DT>\r
+<DD>\r
+Fix small bugs and modify pages. Add processing time measurement for research.\r
+</DD>\r
 \r
 </DL>\r
 <b>Please see CVS in SourceForge.net to check the file difference between versions.</b>\r
index 05f5122..8fa3174 100644 (file)
@@ -49,12 +49,13 @@ and close your browser.
 
 <table bgcolor="lightyellow" border="1">
 <tr><td>
-Please leave this window as it is (or minimized), and work on another window. 
-If another working window is not popped up, 
-click <a href="%%STARTURL%%" target="_blank"><h3>[Start Page]</h3></a>
- to open.
-</td></tr>
-</table>
+<b>Please keep this window as it is or in minimized mode. </b> 
+Start other browsers or other programs for network usage.  
+Or click <a href="%%STARTURL%%" target="_blank"><b>[Start Page]</b></a> 
+to start browsing (In some browsers, 
+it is needed to push SHIFT or CTRL key to open new window. 
+The window may be popped up automatically, if it is
+permited in the browser setting).  </td></tr> </table>
 
 </BODY>
 </HTML>
index c730615..ca63885 100644 (file)
@@ -48,10 +48,14 @@ Or you can run Java, if you download JavaPlugIn from <a href=http://java.com/ja/
 
 <table bgcolor="lightyellow" border="1">
 <tr><td>
-Please leave this window as it is (or minimized), and work on another window. 
-If another working window is not popped up, 
-click <a href="%%STARTURL%%" target="_blank"><h3>[Start Page]</h3></a>
- to open.
+<b>Please keep this window as it is or in minimized mode. </b>
+Start other browsers or other programs for network usage.  
+Or click <a href="%%STARTURL%%" target="_blank"><b>[Start Page]</b></a>
+ to start browsing 
+(In some browsers, 
+it is needed to push SHIFT or CTRL key to open new window. 
+The window may be popped up automatically, if it is
+permited in the browser setting).
 </td></tr>
 </table>
 
index cfcd951..16b9339 100644 (file)
 
 <table bgcolor="lightyellow" border="1">
 <tr><td>
-This page can be closed. But it is recommended to save this page for termination request and work on another window.
-If another working window is not popped up, 
-click <a href="%%STARTURL%%" target="_blank"><h3>[Start Page]</h3></a>
- to open.
+<b>This page can be closed.</b> But it is recommended to save this page for termination request.
+If possible, keep this window as it is or in minimized mode. 
+And start other browsers or other programs for network usage.  
+Or click <a href="%%STARTURL%%" target="_blank"><b>[Start Page]</b></a>
+ to start browsing 
+(In some browsers, 
+it is needed to push SHIFT or CTRL key to open new window. 
+The window may be popped up automatically, if it is
+permited in the browser setting).
 </td></tr>
 </table>
 
-
 </BODY>
 </HTML>
 
index 4a2c4af..8fe9c14 100644 (file)
@@ -42,10 +42,14 @@ click <a href="%%TERMINATEURL%%"><b>TERMINATE</b></a>,
 
 <table bgcolor="lightyellow" border="1">
 <tr><td>
-Please leave this window as it is (or minimized), and work on another window. 
-If another working window is not popped up, 
-click <a href="%%STARTURL%%" target="_blank"><h3>[Start Page]</h3></a>
- to open.
+<b>Please keep this window as it is or in minimized mode. </b>
+Start other browsers or other programs for network usage. 
+Or click <a href="%%STARTURL%%" target="_blank"><b>[Start Page]</b></a>
+ to start browsing 
+(In some browsers, 
+it is needed to push SHIFT or CTRL key to open new window. 
+The window may be popped up automatically, if it is
+permited in the browser setting).
 </td></tr>
 </table>
 
index 0d95122..c045853 100644 (file)
@@ -43,7 +43,7 @@ SEND.
 
 
 <hr>
-Watchdog (Change only when default is malfunctioned)<br />
+Watchdog (Change only when the network is closed frequently)<br />
 <input type="radio" name="watchmode" value="H" %%CHECKHTTP%% >HTTP &nbsp; 
 <input type="radio" name="watchmode" value="J" %%CHECKJAVA%% >JAVA &nbsp; 
 <input type="radio" name="watchmode" value="T" %%CHECKTIME%% >
index e71e257..f9d686e 100644 (file)
@@ -44,7 +44,7 @@ Please use SSL Authentication as far as possible to prevent wiretapping.
 </TABLE>
 
 <hr>
-Watchdog (Change only when the system is malfunctioned)<br />
+Watchdog (Change only when the network is closed frequently)<br />
 <input type="radio" name="watchmode" value="H" %%CHECKHTTP%% >HTTP &nbsp; 
 <input type="radio" name="watchmode" value="J" %%CHECKJAVA%% >JAVA &nbsp; 
 <input type="radio" name="watchmode" value="T" %%CHECKTIME%% >
index 44c46c0..8a3058a 100644 (file)
@@ -36,7 +36,8 @@ if(!navigator.javaEnabled()){
 </div>
 <hr />
 
-<p>\e$B>e$N\e(B2\e$BK\$N@~$N4V$K2+?'$N%P!<$,I=<($5$l$J$$>l9g!"\e(B<a href="%%TERMINATEURL%%"><b>\e$BMxMQCfCG\e(B</b></a>\e$B$r%/%j%C%/$7$F$+$i\e(B
+<p>\e$B>e$N\e(B2\e$BK\$N@~$N4V$K2+?'$N%P!<$,I=<($5$l$J$$>l9g!"\e(B
+<a href="%%TERMINATEURL%%"><b>\e$BMxMQCfCG\e(B</b></a>\e$B$r%/%j%C%/$7$F$+$i\e(B
 \e$B%V%i%&%6$r=*N;$7$F$/$@$5$$!#\e(B
 
 <script language="JavaScript">
@@ -47,8 +48,11 @@ if(!navigator.javaEnabled()){
 
 <table bgcolor="lightyellow" border="1">
 <tr><td>
-<b>\e$B$3$N%Z!<%8$O$3$N$^$^$K!JKt$O:G>/2=!K$7$F!"JL$N%&%$%s%I%&$G:n6H$7$F$/$@$5$$!#\e(B</b>
-\e$B:n6HMQ%&%#%s%I%&$,3+$+$J$$>l9g$K$O!"\e(B<a href="%%STARTURL%%" target="_blank"><h3>[\e$B%9%?!<%H%Z!<%8\e(B]</h3></a>\e$B$r%/%j%C%/$7$F$/$@$5$$!#\e(B
+<b>\e$B$3$N%Z!<%8$O$3$N$^$^$+!"Kt$O:G>/2=>uBV$K$7$F2<$5$$!#\e(B</b>
+\e$B%M%C%H%o!<%/MxMQ$O!"JL$K%V%i%&%6$=$NB>$N%M%C%H%o!<%/MxMQ%W%m%0%i%`$r5/F0$7$F9T$C$F$/$@$5$$!#\e(B
+\e$B$^$?$O!"\e(B<a href="%%STARTURL%%" target="_blank"><b>[\e$B%9%?!<%H%Z!<%8\e(B]
+</b></a>\e$B$+$i3+;O$7$F$/$@$5$$!J%V%i%&%6$K$h$C$F$O!"%7%U%H$^$?\e(B
+\e$B$O%3%s%H%m!<%k%-!<$r2!$7$J$,$i%/%j%C%/$9$kI,MW$,$"$j$^$9!#%]%C%W%"%C%W5v2D$K@_Dj$9$l$P<+F0I=<(2DG=$G$9!K!#\e(B
 
 </td></tr>
 </table>
index a07c935..31657c2 100644 (file)
@@ -47,9 +47,11 @@ if(!navigator.javaEnabled()){
 
 <table bgcolor="lightyellow" border="1">
 <tr><td>
-<b>\e$B$3$N%Z!<%8$O$3$N$^$^$K!JKt$O:G>/2=!K$7$F!"JL$N%&%$%s%I%&$G:n6H$7$F$/$@$5$$!#\e(B</b>
-\e$B:n6HMQ%&%#%s%I%&$,3+$+$J$$>l9g$K$O!"\e(B<a href="%%STARTURL%%" target="_blank"><h3>[\e$B%9%?!<%H%Z!<%8\e(B]</h3></a>\e$B$r%/%j%C%/$7$F$/$@$5$$!#\e(B
-
+<b>\e$B$3$N%Z!<%8$O$3$N$^$^$+!"Kt$O:G>/2=>uBV$K$7$F2<$5$$!#\e(B</b>
+\e$B%M%C%H%o!<%/MxMQ$O!"JL$K%V%i%&%6$=$NB>$N%M%C%H%o!<%/MxMQ%W%m%0%i%`$r5/F0$7$F9T$C$F$/$@$5$$!#\e(B
+\e$B$^$?$O!"\e(B<a href="%%STARTURL%%" target="_blank"><b>[\e$B%9%?!<%H%Z!<%8\e(B]
+</b></a>\e$B$+$i3+;O$7$F$/$@$5$$!J%V%i%&%6$K$h$C$F$O!"%7%U%H$^$?\e(B
+\e$B$O%3%s%H%m!<%k%-!<$r2!$7$J$,$i%/%j%C%/$9$kI,MW$,$"$j$^$9!#%]%C%W%"%C%W5v2D$K@_Dj$9$l$P<+F0I=<(2DG=$G$9!K!#\e(B
 </td></tr>
 </table>
 
index b6277c8..3fa1b1d 100644 (file)
 
 <table bgcolor="lightyellow" border="1">
 <tr><td>
-\e$B$3$N%Z!<%8$OJD$8$F$b9=$$$^$;$s$,!"MxMQCfCGMW5a$N$?$a$KJ];}$7$F$*$-!"JL$N%&%$%s%I%&$G:n6H$9$k$3$H$r4+$a$^$9!#\e(B
-\e$B:n6HMQ%&%#%s%I%&$,3+$+$J$$>l9g$K$O!"\e(B
-<a href="%%STARTURL%%" target="_blank"><h3>[\e$B%9%?!<%H%Z!<%8\e(B]</h3></a>\e$B$r%/%j%C%/$7$F$/$@$5$$!#\e(B
-
-</td></tr>
+<b>\e$B$3$N%Z!<%8$OJD$8$F$b9=$$$^$;$s!#\e(B</b>\e$BMxMQCfCG%j%s%/$rJ];}$9$k$?$a!"\e(B
+\e$B2DG=$G$"$l$P!"$3$N%Z!<%8$r$3$N$^$^$+!"Kt$O:G>/2=>uBV$K$7$F2<$5$$!#\e(B
+\e$B%M%C%H%o!<%/MxMQ$O!"JL$K%V%i%&%6$=$NB>$N%M%C%H%o!<%/MxMQ%W%m%0%i%`$r5/F0$7$F9T$C$F$/$@$5$$!#\e(B
+\e$B$^$?$O!"\e(B<a href="%%STARTURL%%" target="_blank"><b>[\e$B%9%?!<%H%Z!<%8\e(B]
+</b></a>\e$B$+$i3+;O$7$F$/$@$5$$!J%V%i%&%6$K$h$C$F$O!"%7%U%H$^$?\e(B
+\e$B$O%3%s%H%m!<%k%-!<$r2!$7$J$,$i%/%j%C%/$9$kI,MW$,$"$j$^$9!#%]%C%W%"%C%W5v2D$K@_Dj$9$l$P<+F0I=<(2DG=$G$9!K!#\e(B</td></tr>
 </table>
 
 </body>
index da389c1..bf4c526 100644 (file)
@@ -17,7 +17,7 @@ Web\e$B%V%i%&%6$,=*N;$7$?$H$-$K!"%M%C%H%o!<%/MxMQ5v2D$b<+F0E*$K<h$j>C$5$l$^$9!#0-
 (<A HREF="http://webmailer.cc.saga-u.ac.jp/">\e$B%&%'%V%a%$%i!<\e(B</A>)
 <A HREF="http://www.lib.saga-u.ac.jp/">\e$BBg3XImB0?^=q4[$N%Z!<%8\e(B</A>
 <A HREF="http://job.admin.saga-u.ac.jp/">\e$BBg3X="?&AjCL<<$N%Z!<%8\e(B</A>
-<A HREF="http://www.sagadirect.net/index.php/">SAGA\e$B%@%$%l%/%H\e(B</A>
+<A HREF="http://www.sagadirect.net/index.php">SAGA\e$B%@%$%l%/%H\e(B</A>
 </P>
 <HR>
 <P>\e$B8!:w%(%s%8%s\e(B&amp;\e$B%]!<%?%k%5%$%H\e(B</P>
index c64b35d..8bef001 100644 (file)
 
 <table bgcolor="lightyellow" border="1">
 <tr><td>
-<b>\e$B$3$N%Z!<%8$O$3$N$^$^$K!JKt$O:G>/2=!K$7$F!"JL$N%&%$%s%I%&$G:n6H$7$F$/$@$5$$!#\e(B</b>
-\e$B:n6HMQ%&%#%s%I%&$,3+$+$J$$>l9g$K$O!"\e(B
-<a href="%%STARTURL%%" target="_blank"><h3>[\e$B%9%?!<%H%Z!<%8\e(B]</h3></a>
-\e$B$r%/%j%C%/$7$F$/$@$5$$!#\e(B
-</td></tr>
+<b>\e$B$3$N%Z!<%8$O$3$N$^$^$+!"Kt$O:G>/2=>uBV$K$7$F2<$5$$!#\e(B</b>
+\e$B%M%C%H%o!<%/MxMQ$O!"JL$K%V%i%&%6$=$NB>$N%M%C%H%o!<%/MxMQ%W%m%0%i%`$r5/F0$7$F9T$C$F$/$@$5$$!#\e(B
+\e$B$^$?$O!"\e(B<a href="%%STARTURL%%" target="_blank"><b>[\e$B%9%?!<%H%Z!<%8\e(B]
+</b></a>\e$B$+$i3+;O$7$F$/$@$5$$!J%V%i%&%6$K$h$C$F$O!"%7%U%H$^$?\e(B
+\e$B$O%3%s%H%m!<%k%-!<$r2!$7$J$,$i%/%j%C%/$9$kI,MW$,$"$j$^$9!#%]%C%W%"%C%W5v2D$K@_Dj$9$l$P<+F0I=<(2DG=$G$9!K!#\e(B</td></tr>
 </table>
 
 <script type="text/JavaScript">
index 2b69b92..5431f3d 100644 (file)
@@ -40,7 +40,7 @@
 </table>
 
 <hr>
-\e$B3+J|4F;k!JDL>o$O$3$N$^$^$G7k9=$G$9!#F0:n$,$*$+$7$$$H$-$KJQ99$7$F$/$@$5$$!#!K\e(B<br />
+\e$B3+J|4F;k!JDL>o$O$3$N$^$^$G7k9=$G$9!#IQHK$K@Z$l$k$H$-$OJQ99$7$F$/$@$5$$!#!K\e(B<br />
 <input type="radio" name="watchmode" value="H" %%CHECKHTTP%% >HTTP &nbsp; 
 <input type="radio" name="watchmode" value="J" %%CHECKJAVA%% >JAVA &nbsp; 
 <input type="radio" name="watchmode" value="T" %%CHECKTIME%% >
index 151c5f1..69e7f7e 100644 (file)
@@ -42,7 +42,7 @@
 </TABLE>
 
 <hr>
-\e$B3+J|4F;k!JDL>o$O$3$N$^$^$G7k9=$G$9!#F0:n$,$*$+$7$$$H$-$KJQ99$7$F$/$@$5$$!#!K\e(B<br />
+\e$B3+J|4F;k!JDL>o$O$3$N$^$^$G7k9=$G$9!#IQHK$K@Z$l$k$H$-$OJQ99$7$F$/$@$5$$!#!K\e(B<br />
 <input type="radio" name="watchmode" value="H" %%CHECKHTTP%% >HTTP &nbsp; 
 <input type="radio" name="watchmode" value="J" %%CHECKJAVA%% >JAVA &nbsp; 
 <input type="radio" name="watchmode" value="T" %%CHECKTIME%% >
index 6184f29..e4ac5aa 100644 (file)
@@ -11,8 +11,8 @@ Opengate\e$B$K$h$k!V%M%C%H%o!<%/MxMQG'>Z!W$N%Z!<%8$X<+F00\F0$7$^$9!#\e(B
 <P>
 \e$B<+F00\F0$G$-$J$$J}$O$3$A$i$r%/%j%C%/$7$F2<$5$$!#\e(B
 <P>
-<a href="https://%%AUTHCGIURL%%?%%addr=ADDR4%%&lang=ja">\e$B%M%C%H%o!<%/MxMQ<TG'>Z\e(B</a><br>
-<a href="http://%%AUTHCGIURL%%?%%addr=ADDR4%%&lang=ja">\e$B%M%C%H%o!<%/MxMQ<TG'>Z!J\e(BSSL\e$BHsBP1~!K\e(B</a>
+<a href="https://%%AUTHCGIURL%%?addr=%%ADDR4%%&lang=ja">\e$B%M%C%H%o!<%/MxMQ<TG'>Z\e(B</a><br>
+<a href="http://%%AUTHCGIURL%%?addr=%%ADDR4%%&lang=ja">\e$B%M%C%H%o!<%/MxMQ<TG'>Z!J\e(BSSL\e$BHsBP1~!K\e(B</a>
 <HR>
 \e$B:42lBg3X\e(B
 </BODY>
index d987a2c..2f4a4de 100644 (file)
@@ -162,3 +162,6 @@ test-watch-client.o:        ${HDRS}
 test-cgi.o:    ${HDRS}
 
 
+
+
+
index d52e782..76f12c6 100644 (file)
@@ -345,6 +345,11 @@ void putClientAccept(char *userid, char *sessionId, int port, int pid, char *cli
   printf("Content-type: text/html\r\n\r\n\r\n");
   while(fgets(buff, BUFFMAXLN, fp)!=NULL){
 
+    /* length check */
+    if(strlen(buff)>=BUFFMAXLN-1){
+      err_msg("ERR at %s#%d: too long line in %s",__FILE__,__LINE__,acceptdoc);
+    }
+
     /* replace mark */
     htmlReplace(buff, "%%OPENGATEDIR%%", opengateDir);
     htmlReplace(buff, "%%OPENGATEPORT%%", portStr);
index 099a765..e91d93f 100644 (file)
@@ -168,7 +168,7 @@ int openClientGate(char *clientAddr4, char *macAddr4, char *clientAddr6, char *m
       RemoveOverlapRule(overlapRule4,overlapRule6);
       KillOverlapProcess(overlapRule4,overlapRule6,clientAddr4,clientAddr6);
 
-      err_msg("INFO: user %s forces to close overlapped client", userid);
+      if(debug>0)err_msg("INFO: user %s forces to close overlapped client", userid);
       PutClientMsg("Network is closed. Please End Web and Retry. ");
     }
     return FALSE;
index 4ba0f80..5d4aebe 100644 (file)
@@ -28,7 +28,7 @@ Programmed by Yoshiaki WATANABE
 #include "opengatesrv.h"
 #include "../ezxml/ezxml.h"
 
-#define CONFFILE_VERSION "1.4.5"
+#define CONFIG_VERSION "1.4.7"
 #define SEPARATOR "/"
 
 int debug=0;
@@ -81,8 +81,8 @@ int openConfFile(void)
   }
 
   /* check the config file version */ 
-  if(isNull(ezxml_attr(xmlRoot, "version"))||
-     (strcmp(CONFFILE_VERSION, ezxml_attr(xmlRoot, "version"))!=0)){
+  if(isNull(ezxml_attr(xmlRoot, "ConfigVersion"))||
+     (strcmp(CONFIG_VERSION, ezxml_attr(xmlRoot, "ConfigVersion"))!=0)){
     strncpy(buff, "<H3>Error: Opengate configuration file ",BUFFMAXLN);
     strncat(buff, CONFIGFILE, BUFFMAXLN);
     strncat(buff, " has mismatch version.<br> Please update it with ",BUFFMAXLN);
@@ -230,11 +230,9 @@ char *getConfValue(char *name)
 
   /* if not get, write error message */
   if(isNull(pValue)){
+    /* AuthServer parameters (except Protocol) might be omitted */
     if((strstr(name,"AuthServer")==name)&&
        strstr(name,"AuthServer/Protocol")==NULL){
-      /* AuthServer parameters (except Protocol) might be omitted */
-      /* in some auth server setting such as pam */
-
     }else{
       /* other parameters must be set */
       err_msg("ERR at %s#%d: cannot get %s from conf file",__FILE__,__LINE__,name);
index 3b2b4b9..a6dc2b5 100644 (file)
@@ -40,6 +40,11 @@ int htmlTemplate(char* filename, struct html_key* keys)
 
   while(fgets(buff,BUFFMAXLN,fp)!=NULL){
 
+    /* length check */
+    if(strlen(buff)>=BUFFMAXLN-1){
+      err_msg("ERR at %s#%d: too long line in %s",__FILE__,__LINE__,filename);
+    }
+
     i=0;
     while( strcmp(keys[i].name,"")!=0 ){
       htmlReplace(buff, keys[i].name, keys[i].val);
index 728a517..2c057c7 100644 (file)
@@ -41,6 +41,9 @@ char extraId[USERMAXLN];
 char userProperty[BUFFMAXLN];
 time_t timeIn, timeOut;
 int connectionMode;   /* client connect mode */
+/* variable to measuring processing time (in msec) */
+struct timeval timeBeginCgi, timeBeginWait, timeConnect, timeDisconnect;
+
 char sessionId[BUFFMAXLN];    /* session ID */
 
 void PutCloseMsg(time_t timeOut, time_t timeIn);
@@ -63,6 +66,9 @@ int  main(int argc, char **argv)
   int ipStatus;              /* flag for IPv4 or IPv6 */
   char watchMode[WORDMAXLN];  /* client watch mode Http or Java or Timeout */
 
+  /* get time at the cgi starting (in msec) */
+  gettimeofday(&timeBeginCgi, NULL) ;
+
   /* prepare config file */
   if(OpenConfFile()==-1) return 0;
  
@@ -177,11 +183,17 @@ int  main(int argc, char **argv)
 
   Pipe(dummyfd);      /* connect dummy pipe for stdin and out */
 
+  /* get time at the client wait start (in msec) */
+  gettimeofday(&timeBeginWait, NULL) ;
+
   /* wait connection from the client */
   /* if no connection, close gate when duration is passed */
   /* or ipaddr for the macAddr4 is changed */
   connectionMode=WaitClientConnect(userid, userProperty, sessionId, clientAddr4, clientAddr6, duration, macAddr4, macAddr6, ipStatus, pClientAddr, language, port, parentpid);
 
+  /* get time at the client connection (in msec) */
+  gettimeofday(&timeConnect, NULL) ;
+
   if(connectionMode==JAVACONNECT){
 
     /* wait until the java applet quit */
@@ -281,9 +293,35 @@ void setProcessTitle(char *useridshort, char *clientAddr4, char * ruleNumber4, c
 void logConnectMode(char *userid)
 {
   char *mode[4]={"NONE","JAVA","HTTP","TIME"};
+  long time1sec,time2sec,time3sec;
+  long time1usec,time2usec,time3usec;
+
+  /* get time at the end of connection (in msec) */
+  gettimeofday(&timeDisconnect, NULL) ;
+
+  /* time difference (seconds(sec) and micro-seconds(usec)) */
+  time1sec=(timeBeginWait.tv_sec - timeBeginCgi.tv_sec);
+  time1usec=(timeBeginWait.tv_usec - timeBeginCgi.tv_usec);
+  if(time1usec<0){
+    time1usec += 1000000; time1sec--;
+  }
+  time2sec=(timeConnect.tv_sec - timeBeginWait.tv_sec);
+  time2usec=(timeConnect.tv_usec - timeBeginWait.tv_usec);
+  if(time2usec<0){
+    time2usec += 1000000; time2sec--;
+  }
+  time3sec=(timeDisconnect.tv_sec - timeConnect.tv_sec);
+  time3usec=(timeDisconnect.tv_usec - timeConnect.tv_usec);
+  if(time3usec<0){
+    time3usec += 1000000; time3sec--;
+  }
 
   if(connectionMode<0 || connectionMode>3) connectionMode=0;
-  if(debug>0) err_msg("INFO: user %s is watched by [%s]",userid, mode[connectionMode]);
+  if(debug>0) err_msg("INFO: user %s is watched by [%s] procsec(%ld.%ld,%ld.%ld,%ld.%ld)",
+                     userid, mode[connectionMode], 
+                     time1sec,time1usec,
+                     time2sec,time2usec,
+                     time3sec,time3usec);
 }
 
 
index 0546558..572d2f7 100644 (file)
@@ -49,6 +49,8 @@ int main(){
         getenv("CONTENT_LENGTH"));
   printf("<TR><TD>HTTP_REFERER</TD><TD>%s</TD></TR>\r\n",
         getenv("HTTP_REFERER"));
+  printf("<TR><TD>HTTP_USER_AGENT</TD><TD>%s</TD></TR>\r\n",
+        getenv("HTTP_USER_AGENT"));
 
   printf("</TABLE>         \r\n");  
   printf("</BODY></HTML> \r\n\r\n");
index 8d85811..242c837 100644 (file)
@@ -784,6 +784,11 @@ void sendHttpKeepPage(char *userid, char *sessionId, char *language, int port)
 
   while(fgets(buff, BUFFMAXLN, fp)!=NULL){
 
+    /* length check */
+    if(strlen(buff)>=BUFFMAXLN-1){
+      err_msg("ERR at %s#%d: too long line in %s",__FILE__,__LINE__,httpKeepDoc);
+    }
+
     /* replace mark */
     htmlReplace(buff, "%%HTTPHELLOINTERVAL%%", httpHelloInterval);
     htmlReplace(buff, "%%HTTPHELLOURL%%", httpHelloUrl);