OSDN Git Service

Ver.1.4.16: Fix bug for delayed favicon.ico request occured on Vista PC and others.
authorwatanaby <>
Mon, 16 Apr 2007 00:42:47 +0000 (00:42 +0000)
committerwatanaby <>
Mon, 16 Apr 2007 00:42:47 +0000 (00:42 +0000)
opengate/conf/opengatesrv.conf.sample
opengate/doc/Changes.html
opengate/javahtml/httpkeep.js
opengate/opengatesrv/get-param.c
opengate/opengatesrv/utilities.c
opengate/opengatesrv/watch-client.c

index 4b2b05a..e63b62a 100644 (file)
@@ -1,5 +1,5 @@
 <?xml version="1.0"?>
-<Opengate ConfigVersion="1.4.11">
+<Opengate ConfigVersion="1.4.16">
 
 <!-- ################################################# 
 #    ####### NEED TO MODIFY FOLLOWING PARAMETERS #####  -->
        </ListenPort>
 
        <!-- communication reply timeout(second) -->
-       <CommWaitTimeout>10</CommWaitTimeout>
+       <CommWaitTimeout>30</CommWaitTimeout>
 
        <!-- Java connection timeout(second) -->
        <JavaWaitTimeout>600</JavaWaitTimeout>
 
        <!-- http reconnect timeout(second) -->
-       <ReconnectTimeout>10</ReconnectTimeout>
+       <ReconnectTimeout>30</ReconnectTimeout>
 
        <!-- ipfw exclusive exec lock timeout (second) -->
        <LockTimeout>10</LockTimeout>
index 3643db9..8fe0dac 100644 (file)
@@ -558,6 +558,11 @@ Ver.1.4.15 at 2007.3.22</DT>
 <DD>\r
 Fix bug at dumping micro-second time information. \r
 </DD>\r
+<DT>\r
+Ver.1.4.16 at 2007.4.15</DT>\r
+<DD>\r
+Fix bug for delayed favicon.ico request occured on Vista PC and others.\r
+</DD>\r
 \r
 </DL>\r
 <b>Please see CVS in SourceForge.net to check the file difference between versions.</b>\r
index 33e4e28..43a0fc6 100644 (file)
@@ -5,6 +5,7 @@ var httpObj;
 var nextKey;
 var nowKey;
 var sessionId;
+var initial;
 
 function createXMLHttpRequest() {
   try { return new ActiveXObject("Msxml2.XMLHTTP");    } catch(e) {}
@@ -45,7 +46,14 @@ function displayResponse()
         hh=today.getHours();  mm=today.getMinutes();
         if(hh<10)hh='0'+hh;   if(mm<10)mm='0'+mm;
         document.getElementById("dispmsg").innerHTML = hh+':'+mm;
-        if(httpObj.responseText=="hello") sendHello();
+        if(httpObj.responseText=="hello"){
+          if(initial==1){
+            setTimeout('sendHello()',10000); 
+            initial=0;
+          }else{
+            sendHello();
+          }
+        }
       }else{
         document.getElementById("dispmsg").innerHTML = "Error!";
       }
@@ -64,8 +72,9 @@ function initHttpkeep(urlArg, appletArg, sid)
   sessionId=sid;
   rand=Math.random();
   nextKey=hex_md5(String(rand));
+  initial=1;
 
-  // set timeout and send hello 
+  // send hello 
   sendHello();
 }
 //-->
index 2459c7f..15c9e20 100644 (file)
@@ -28,7 +28,7 @@ Programmed by Yoshiaki WATANABE
 #include "opengatesrv.h"
 #include "../ezxml/ezxml.h"
 
-#define CONFIG_VERSION "1.4.11"
+#define CONFIG_VERSION "1.4.16"
 #define SEPARATOR "/"
 
 int debug=0;
index c7118c8..804c631 100644 (file)
@@ -114,6 +114,7 @@ readln(int fd, void *vptr, size_t maxlen)
   }
   /* null terminate string */  
   *ptr++ = 0;
+
   return(n);
 }
 
index 5142cf6..34b025b 100644 (file)
@@ -35,6 +35,7 @@ void AcceptHttpReConnect(void);
 int MacAddrCheck(int ipStatus,char *clientAddr4, char *clientAddr6, char *macAddr4, char *macAddr6);
 int IsRightKey(char *pNowKey, char *sessionId);
 void SendHttpReply(char *reply);
+void SendHttpNotFound(void);
 
 void OnUsageTimeLimitAlarm(int signo);
 void OnCheckBasicAlarm(int signo);
@@ -281,6 +282,10 @@ int waitClientConnect(char *userid, char *userProperty, char *sessionId, char *c
     }
 
     /* other request is ignored */
+    if(strstr(buff, "GET /")==buff){
+      ReadHttpHeaders();
+      SendHttpNotFound();
+    }
     Close(connfd);
     continue;
   }
@@ -663,8 +668,13 @@ void waitHttpClose(struct clientAddr *pClientAddr, char *userid, char *userPrope
       
       /* read other string */
       else{
+       
+       /* read request and reply not found */
+       ReadHttpHeaders();
+       SendHttpNotFound();
       }
     }
+
     else{
       /*abnormal read */
       /* some alarm is ringed or connecion is closed */
@@ -989,6 +999,16 @@ void sendHttpReply(char *reply)
   Writefmt(connfd,"\r\n");
 }
 
+/*************************************************************/
+/* send NOT FOUND reply to unknown http request              */
+/*************************************************************/
+void sendHttpNotFound(void)
+{
+  /* send HTTP headers */
+  Writefmt(connfd,"HTTP/1.1 404\r\n");
+  Writefmt(connfd,"\r\n");
+}
+
 /***************************************************/
 /***************************************************/
 void GetPeerAddr(int sockfd, char *peerAddr)
@@ -1159,3 +1179,8 @@ void SendHttpReply(char *reply){
 
 
 
+void SendHttpNotFound(void){
+  if(debug>1) err_msg("DEBUG:=>sendHttpNotFound()");
+  sendHttpNotFound();
+  if(debug>1) err_msg("DEBUG:<=sendHttpNotFound()");
+}