diff options
author | Dennis Friis <peavey@inspircd.org> | 2009-07-07 00:52:08 +0200 |
---|---|---|
committer | Dennis Friis <peavey@inspircd.org> | 2009-07-07 00:55:31 +0200 |
commit | 4673fd3ca06010e74f8223486b0f34e58c7b0a7e (patch) | |
tree | cfcc97752fd770eb1befa295e16f7aa4a2607ca9 /src/char_sql | |
parent | 03b5e644857f80a23bd8b856b78a10cf0a564a66 (diff) | |
download | tmwa-4673fd3ca06010e74f8223486b0f34e58c7b0a7e.tar.gz tmwa-4673fd3ca06010e74f8223486b0f34e58c7b0a7e.tar.bz2 tmwa-4673fd3ca06010e74f8223486b0f34e58c7b0a7e.tar.xz tmwa-4673fd3ca06010e74f8223486b0f34e58c7b0a7e.zip |
Fixes to socket system to make it cope better with fd depletion.
Also added timeout for fullconnect, secured map server from stateless
connections.
Diffstat (limited to 'src/char_sql')
-rw-r--r-- | src/char_sql/char.c | 12 | ||||
-rw-r--r-- | src/char_sql/int_guild.c | 4 | ||||
-rw-r--r-- | src/char_sql/inter.c | 4 | ||||
-rw-r--r-- | src/char_sql/itemdb.c | 4 |
4 files changed, 12 insertions, 12 deletions
diff --git a/src/char_sql/char.c b/src/char_sql/char.c index 11b6a49..789a7c7 100644 --- a/src/char_sql/char.c +++ b/src/char_sql/char.c @@ -2586,7 +2586,7 @@ int char_lan_config_read(const char *lancfgName){ FILE *fp; struct hostent * h = NULL; - if ((fp = fopen(lancfgName, "r")) == NULL) { + if ((fp = fopen_(lancfgName, "r")) == NULL) { printf("file not found: %s\n", lancfgName); return 1; } @@ -2619,7 +2619,7 @@ int char_lan_config_read(const char *lancfgName){ printf("set subnetmask : %s\n", w2); } } - fclose(fp); + fclose_(fp); printf("End reading of Lan Support configuration file\n"); return 0; @@ -2667,7 +2667,7 @@ void sql_config_read(const char *cfgName){ /* Kalaspuff, to get login_db */ printf("reading configure: %s\n", cfgName); - if ((fp = fopen(cfgName, "r")) == NULL) { + if ((fp = fopen_(cfgName, "r")) == NULL) { printf("file not found: %s\n", cfgName); exit(1); } @@ -2737,7 +2737,7 @@ void sql_config_read(const char *cfgName){ /* Kalaspuff, to get login_db */ printf("set lowest_gm_level : %s\n",w2); } } - fclose(fp); + fclose_(fp); printf("reading configure done.....\n"); } @@ -2746,7 +2746,7 @@ int char_config_read(const char *cfgName) { char line[1024], w1[1024], w2[1024]; FILE *fp; - if ((fp = fopen(cfgName, "r")) == NULL) { + if ((fp = fopen_(cfgName, "r")) == NULL) { printf("Configuration file not found: %s.\n", cfgName); exit(1); } @@ -2849,7 +2849,7 @@ int char_config_read(const char *cfgName) { char_config_read(w2); } } - fclose(fp); + fclose_(fp); //Read ItemDB do_init_itemdb(); diff --git a/src/char_sql/int_guild.c b/src/char_sql/int_guild.c index 1983896..b9a6e3b 100644 --- a/src/char_sql/int_guild.c +++ b/src/char_sql/int_guild.c @@ -566,7 +566,7 @@ int inter_guild_readdb() char line[1024]; for (i=0;i<100;i++) guild_exp[i]=0; - fp=fopen("db/exp_guild.txt","r"); + fp=fopen_("db/exp_guild.txt","r"); if(fp==NULL){ printf("can't read db/exp_guild.txt\n"); return 1; @@ -578,7 +578,7 @@ int inter_guild_readdb() guild_exp[i]=atoi(line); i++; } - fclose(fp); + fclose_(fp); return 0; } diff --git a/src/char_sql/inter.c b/src/char_sql/inter.c index c8fa9b4..d1ee194 100644 --- a/src/char_sql/inter.c +++ b/src/char_sql/inter.c @@ -157,7 +157,7 @@ int inter_config_read(const char *cfgName) { char line[1024], w1[1024], w2[1024]; FILE *fp; - fp=fopen(cfgName,"r"); + fp=fopen_(cfgName,"r"); if(fp==NULL){ printf("file not found: %s\n", cfgName); return 1; @@ -221,7 +221,7 @@ int inter_config_read(const char *cfgName) { printf ("set login_server_db : %s\n",w2); } } - fclose(fp); + fclose_(fp); printf ("success reading interserver configuration\n"); diff --git a/src/char_sql/itemdb.c b/src/char_sql/itemdb.c index 0bed07c..85c4929 100644 --- a/src/char_sql/itemdb.c +++ b/src/char_sql/itemdb.c @@ -105,7 +105,7 @@ static int itemdb_readdb(void) char *str[32],*p,*np; struct item_data *id; - fp=fopen("db/item_db.txt","r"); + fp=fopen_("db/item_db.txt","r"); if(fp==NULL){ printf("can't read db/item_db.txt\n"); exit(1); @@ -134,7 +134,7 @@ static int itemdb_readdb(void) id->type=atoi(str[3]); } - fclose(fp); + fclose_(fp); printf("read db/item_db.txt done (count=%d)\n",ln); return 0; } |