inc/apacheLog.h File Reference

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  apacheAccessLog

Functions

apacheAccessLogapacheAccessLogParse (char *line, char *fileName, int lineIx)
void apacheAccessLogFree (struct apacheAccessLog **pLl)


Function Documentation

void apacheAccessLogFree ( struct apacheAccessLog **  pLl  ) 

Definition at line 10 of file apacheLog.c.

References apacheAccessLog::buf, freeMem(), and freez().

00012 {
00013 struct apacheAccessLog *ll = *pLl;
00014 if (ll != NULL)
00015     {
00016     freeMem(ll->buf);
00017     freez(pLl);
00018     }
00019 }

Here is the call graph for this function:

struct apacheAccessLog* apacheAccessLogParse ( char *  line,
char *  fileName,
int  lineIx 
) [read]

Definition at line 60 of file apacheLog.c.

References AllocVar, badFormat(), badTimeStamp(), apacheAccessLog::buf, cloneString(), apacheAccessLog::dash1, apacheAccessLog::dash2, apacheAccessLog::httpVersion, apacheAccessLog::ip, apacheAccessLog::method, nextWord(), apacheAccessLog::num1, parseQuotedString(), apacheAccessLog::program, apacheAccessLog::referrer, sameString, shortLine(), apacheAccessLog::status, apacheAccessLog::timeStamp, apacheAccessLog::timeZone, unterminatedQuote(), and apacheAccessLog::url.

00064 {
00065 struct apacheAccessLog *ll;
00066 char *buf, *s, *e;
00067 AllocVar(ll);
00068 ll->buf = buf = cloneString(line);
00069 ll->ip = nextWord(&buf);
00070 ll->dash1 = nextWord(&buf);
00071 ll->dash2 = nextWord(&buf);
00072 if (buf == NULL)
00073     {
00074     shortLine(&ll, line, fileName, lineIx);
00075     return NULL;
00076     }
00077 s = strchr(buf, '[');
00078 if (s == NULL)
00079     {
00080     badTimeStamp(&ll, line, fileName, lineIx);
00081     return NULL;
00082     }
00083 s += 1;
00084 e = strchr(s, ']');
00085 if (e == NULL)
00086     {
00087     badTimeStamp(&ll, line, fileName, lineIx);
00088     return NULL;
00089     }
00090 *e = 0;
00091 ll->timeStamp = nextWord(&s);
00092 if (!isdigit(ll->timeStamp[0]))
00093     {
00094     badTimeStamp(&ll, line, fileName, lineIx);
00095     return NULL;
00096     }
00097 ll->timeZone = nextWord(&s);
00098 buf = e+2;
00099 if (buf[0] != '"')
00100     {
00101     badFormat(&ll, line, fileName, lineIx, "Missing quote after time stamp");
00102     return NULL;
00103     }
00104 if (!parseQuotedString(buf, buf, &e))
00105     {
00106     unterminatedQuote(&ll, line, fileName, lineIx);
00107     return NULL;
00108     }
00109 ll->method = nextWord(&buf);
00110 ll->url = nextWord(&buf);
00111 ll->httpVersion = nextWord(&buf);
00112 if (ll->url == NULL)
00113     {
00114     badFormat(&ll, line, fileName, lineIx, "Missing URL");
00115     return NULL;
00116     }
00117 buf = e;
00118 s = nextWord(&buf);
00119 if (!isdigit(s[0]))
00120     {
00121     badFormat(&ll, line, fileName, lineIx, "Non-numerical status code");
00122     return NULL;
00123     }
00124 ll->status = atoi(s);
00125 ll->num1 = nextWord(&buf);
00126 if (buf == NULL)
00127     {
00128     shortLine(&ll, line, fileName, lineIx);
00129     return NULL;
00130     }
00131 if (buf[0] != '"')
00132     {
00133     badFormat(&ll, line, fileName, lineIx, "Missing quote after request");
00134     return NULL;
00135     }
00136 if (!parseQuotedString(buf, buf, &e))
00137     {
00138     unterminatedQuote(&ll, line, fileName, lineIx);
00139     return NULL;
00140     }
00141 if (!sameString(buf, "-"))
00142     ll->referrer = buf;
00143 buf = e + 1;
00144 if (buf[0] != '"')
00145     {
00146     badFormat(&ll, line, fileName, lineIx, "Missing quote after referrer");
00147     return NULL;
00148     }
00149 if (!parseQuotedString(buf, buf, &e))
00150     {
00151     unterminatedQuote(&ll, line, fileName, lineIx);
00152     return NULL;
00153     }
00154 ll->program = buf;
00155 return ll;
00156 }

Here is the call graph for this function:


Generated on Tue Dec 25 18:41:05 2007 for blat by  doxygen 1.5.2