--------------------- PatchSet 4051 Date: 2002/04/21 19:36:46 Author: kinkie Branch: customlog Tag: (none) Log: Implemented access_log config-tag parsing function. Members: src/cache_cf.c:1.41.4.2->1.41.4.3 Index: squid/src/cache_cf.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/cache_cf.c,v retrieving revision 1.41.4.2 retrieving revision 1.41.4.3 diff -u -r1.41.4.2 -r1.41.4.3 --- squid/src/cache_cf.c 9 Apr 2002 21:57:40 -0000 1.41.4.2 +++ squid/src/cache_cf.c 21 Apr 2002 19:36:46 -0000 1.41.4.3 @@ -1,6 +1,6 @@ /* - * $Id: cache_cf.c,v 1.41.4.2 2002/04/09 21:57:40 kinkie Exp $ + * $Id: cache_cf.c,v 1.41.4.3 2002/04/21 19:36:46 kinkie Exp $ * * DEBUG: section 3 Configuration File Parsing * AUTHOR: Harvest Derived @@ -2479,7 +2479,45 @@ static void parse_access_log_def(customlog **customlog_definitions) { -#warning "TODO: implement this" + char *cp,*filename, *logdef_name; + customlog *cl; + logformat *lf; + acl_list *acls; + + cl=xmalloc(sizeof(customlog)); + logdef_name=strtok(NULL,w_space); + debug(3,0)("Log definition name is '%s'\n",logdef_name); + /* look for the definition pointer corresponding to this name */ + lf=(Config.Log.logformatsList); + while (lf != NULL) { + debug(3,0)("Comparing against '%s'\n",lf->name); + if (strcmp(lf->name,logdef_name)==0) + break; + lf=lf->next; + } + if (lf==NULL) { + xfree(cl); + fatalf("Log format '%s' is not defined\n", logdef_name); + } else { + debug(3,0)("Got log format '%s'\n",lf->name); + } + + cp=strtok(NULL,w_space); + debug(3,0)("Filename is '%s'\n",cp); + if (!cp) { + xfree(cl); + fatal("Can't parse custom access log filename\n"); + } + filename=xmalloc(strlen(cp)+1); + strcpy(filename,cp); + + aclParseAclList(&acls); + + cl->filename=filename; + cl->aclList=acls; + cl->logFormat=lf; + cl->next=*customlog_definitions;; + *customlog_definitions=cl; } static void