summaryrefslogtreecommitdiff
path: root/src/file.c
diff options
context:
space:
mode:
authorJakub Sławiński2005-08-05 21:45:31 +0200
committerJoshua Judson Rosen2014-07-17 21:14:59 +0200
commit43e8714797d40bcf63efab428dcd25f9caf1d52b (patch)
tree796974a873a97f2a44f872f3dd3587508e35aa64 /src/file.c
parentv0.7.1 (diff)
downloadapf-43e8714797d40bcf63efab428dcd25f9caf1d52b.tar.gz
v0.7.2
- Added: http proxy basic authorization - Fixed: logging initialization after some value checking - Fixed: auto-reconnect failure when --nossl option is set - Added: auto-reconnect when afserver is not reachable on start - Added: auto-reconnect after normal afserver quit - Added: per user statistics: idle time, amount of downloaded/uploaded bytes and current download/upload rate - Added: support for https proxies - Added: possibility to bind sockets on different interfaces - Fixed: receiving incomplete headers from afclient - Fixed: close user connections by afclient
Diffstat (limited to 'src/file.c')
-rw-r--r--src/file.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/file.c b/src/file.c
index 728b0c1..297503b 100644
--- a/src/file.c
+++ b/src/file.c
@@ -110,7 +110,7 @@ parsefile(char* name, int* status)
{
static ConfigurationT cfg;
FILE* file = NULL;
- int state, i, n, listencount, managecount;
+ int state, i, j, n, listencount, managecount;
char buff[256];
char helpbuf1[256];
char helpbuf2[256];
@@ -187,8 +187,16 @@ parsefile(char* name, int* status)
return cfg;
}
- for (i=0; i<cfg.size; ++i) {
- cfg.realmtable[i].usrclitable = calloc(cfg.realmtable[i].usrclinum, sizeof(UsrCliT));
+ for (i = 0; i < cfg.size; ++i) {
+ cfg.realmtable[i].usrclitable = calloc(cfg.realmtable[i].usrclinum, sizeof(UsrCli*));
+ for (j = 0; j < cfg.realmtable[i].usrclinum; ++j) {
+ cfg.realmtable[i].usrclitable[j] = UsrCli_new();
+ if (cfg.realmtable[i].usrclitable[j] == NULL) {
+ aflog(LOG_T_INIT, LOG_I_CRIT,
+ "Problem with allocating memory for UsrCli structure... exiting");
+ return cfg;
+ }
+ }
}
cfg.size = 0;
@@ -293,8 +301,7 @@ parsefile(char* name, int* status)
strcpy(cfg.realmtable[cfg.size-1].hostname, helpbuf2);
}
else if (strcmp(helpbuf1, "listen")==0) {
- cfg.realmtable[cfg.size-1].usrclitable[listencount].lisportnum=calloc(strlen(helpbuf2)+1, sizeof(char));
- strcpy(cfg.realmtable[cfg.size-1].usrclitable[listencount].lisportnum, helpbuf2);
+ UsrCli_set_listenPortName(cfg.realmtable[cfg.size-1].usrclitable[listencount], helpbuf2);
++listencount;
}
else if (strcmp(helpbuf1, "pass")==0) {
@@ -305,8 +312,7 @@ parsefile(char* name, int* status)
}
}
else if (strcmp(helpbuf1, "manage")==0) {
- cfg.realmtable[cfg.size-1].usrclitable[managecount].manportnum=calloc(strlen(helpbuf2)+1, sizeof(char));
- strcpy(cfg.realmtable[cfg.size-1].usrclitable[managecount].manportnum, helpbuf2);
+ UsrCli_set_managePortName(cfg.realmtable[cfg.size-1].usrclitable[managecount], helpbuf2);
++managecount;
}
else if (strcmp(helpbuf1, "users")==0) {