<?xml version="1.0"?>\r
-<Opengate version="1.4.3">\r
+<Opengate version="1.4.5">\r
\r
<!-- ################################################# \r
# ####### NEED TO MODIFY FOLLOWING PARAMETERS ##### -->\r
<NoPacketInterval>5400</NoPacketInterval>\r
</ActiveCheck>\r
\r
- <!-- HTTP 'HELLO' request interval(sec) to Keep-Alive -->\r
- <!-- this must be smaller than the keep-alive time of browsers -->\r
- <HttpHelloInterval>50</HttpHelloInterval>\r
+ <!-- Watch client with Http Keep-Alive -->\r
+ <HttpWatch>\r
+ <!-- HTTP 'HELLO' request interval(sec) to Keep-Alive -->\r
+ <!-- must be smaller than keep-alive time of browsers -->\r
+ <HelloInterval>50</HelloInterval>\r
+\r
+ <!-- HTTP_USER_AGENT ignoring http watch mode -->\r
+ <!-- defined by "POSIX Extended Regular Expression" -->\r
+ <SkipAgentPattern>Safari/4</SkipAgentPattern>\r
+ </HttpWatch>\r
+\r
+ <!-- Watch client with Java Applet -->\r
+ <JavaWatch>\r
+ <!-- HTTP_USER_AGENT ignoring java watch mode -->\r
+ <!-- defined by "POSIX Extended Regular Expression" -->\r
+ <SkipAgentPattern></SkipAgentPattern>\r
+ </JavaWatch>\r
\r
<!-- IPFW rule number range used by opengate -->\r
<IpfwRule>\r
<DD>\r
Add automatic start of java applet at failing http keep-alive. Modify http-get format. Add session-id. Fix read bug.\r
</DD>\r
+<DT>\r
+Ver.1.4.5 at 2006.10.26</DT>\r
+<DD>\r
+Add function to indicate disable clients for http/java watch. \r
+</DD>\r
\r
</DL>\r
<b>Please see CVS in SourceForge.net to check the file difference between versions.</b>\r
/* convert two-char-hex "aa" to one-number 0Xaa */
#define hex2num(x) ((x)>='A' ? ((x) & 0XDF) - 'A' +10 : ((x) - '0'))
+int isHttpWatchEnableClient(void);
+int isJavaWatchEnableClient(void);
void split(char content[], char *name[], char *value[], char *next[]);
void decode(char *string);
/* HTTP watch mode */
case 'H':
- /* HTTP Keep-Alive is not standard in http/1.0 */
- if(strcmp(getenv("SERVER_PROTOCOL"),"HTTP/1.0")!=0){
+ if(isHttpWatchEnableClient()){
acceptDoc=GetConfValue("AcceptDocHttp");
- } else {
+ }else if(isJavaWatchEnableClient()){
acceptDoc=GetConfValue("AcceptDocJava");
+ }else{
+ acceptDoc=GetConfValue("AcceptDocTime");
}
break;
/* JAVA watch mode */
case 'J':
- acceptDoc=GetConfValue("AcceptDocJava");
+ if(isJavaWatchEnableClient()){
+ acceptDoc=GetConfValue("AcceptDocJava");
+ }else if(isHttpWatchEnableClient()){
+ acceptDoc=GetConfValue("AcceptDocHttp");
+ }else{
+ acceptDoc=GetConfValue("AcceptDocTime");
+ }
break;
/* TIMEOUT watch mode */
return;
}
+/*****************************************************/
+/* is the client enable to keep long http connection */
+/*****************************************************/
+int isHttpWatchEnableClient(void)
+{
+ /* HTTP Keep-Alive is not standard in http/1.0 */
+ if(strcmp(getenv("SERVER_PROTOCOL"),"HTTP/1.0")==0) return FALSE;
+
+ /* some user agent does not support long HTTP Keep-Alive */
+ if(RegExMatch(getenv("HTTP_USER_AGENT"),
+ GetConfValue("HttpWatch/SkipAgentPattern"))) return FALSE;
+
+ return TRUE;
+}
+
+/********************************************/
+/* is the client enable to load Java Applet */
+/********************************************/
+int isJavaWatchEnableClient(void)
+{
+ /* some user agent does not support Java Applet */
+ if(RegExMatch(getenv("HTTP_USER_AGENT"),
+ GetConfValue("JavaWatch/SkipAgentPattern"))) return FALSE;
+
+ return TRUE;
+}
+
/************************************/
/* split value for indicated name */
/* in content "name=value&..." */
#include "opengatesrv.h"
#include "../ezxml/ezxml.h"
-#define CONFFILE_VERSION "1.4.3"
+#define CONFFILE_VERSION "1.4.5"
#define SEPARATOR "/"
int debug=0;
char *getConfValueExtra(char *name);
char *getConfValue(char *name);
char *convertToFacilityRaw(char *pValue);
-int RegExMatch(const char *inStr, const char *regEx);
/**************************************************/
/* Prepare Conf file to use */
void SetupConfExtra(char *userId, char *extraId);
char *GetConfValue(char *name);
void InitConf();
+int RegExMatch(const char *inStr, const char *regEx);
int AddAlarm(char *name, int timeout, int preceding, Sigfunc *func);
int RemoveAlarm(char *name);
GetConfValue("OpengateServerName"), port);
/* create httphello interval [50] */
- snprintf(httpHelloInterval, WORDMAXLN, "%s", GetConfValue("HttpHelloInterval"));
+ snprintf(httpHelloInterval, WORDMAXLN, "%s", GetConfValue("HttpWatch/HelloInterval"));
/* create httpkeep.js url[http://<serveraddr>/opengate/httpkeep.js] */
snprintf(httpkeepJsUrl, BUFFMAXLN, "http://%s%s/%s",