Project

General

Profile

Feature #38 » log-httplog.c.patch

Victor Julien, 06/10/2011 03:18 AM

View differences:

src/log-httplog.c 2011-05-23 12:00:27.015607973 +0100
} else {
fprintf(aft->file_ctx->fp, "<useragent unknown>");
}
fprintf(aft->file_ctx->fp, " [**] ");
/* referer */
htp_header_t *h_referer = table_getc(tx->request_headers, "referer");
if (h_referer != NULL) {
PrintRawUriFp(aft->file_ctx->fp,
(uint8_t *)bstr_ptr(h_referer->value),
bstr_len(h_referer->value));
} else {
fprintf(aft->file_ctx->fp, "<no referer>");
}
fprintf(aft->file_ctx->fp, " [**] ");
/* method */
if (tx->request_method != NULL) {
PrintRawUriFp(aft->file_ctx->fp,
(uint8_t *)bstr_ptr(tx->request_method),
bstr_len(tx->request_method));
}
fprintf(aft->file_ctx->fp, " [**] ");
/* protocol */
if (tx->request_protocol != NULL) {
PrintRawUriFp(aft->file_ctx->fp,
(uint8_t *)bstr_ptr(tx->request_protocol),
bstr_len(tx->request_protocol));
}
/* ip/tcp header info */
fprintf(aft->file_ctx->fp, " [**] %s:%" PRIu16 " -> %s:%" PRIu16 "\n",
......
} else {
fprintf(aft->file_ctx->fp, "<useragent unknown>");
}
fprintf(aft->file_ctx->fp, " [**] ");
/* referer */
htp_header_t *h_referer = table_getc(tx->request_headers, "referer");
if (h_referer != NULL) {
PrintRawUriFp(aft->file_ctx->fp,
(uint8_t *)bstr_ptr(h_referer->value),
bstr_len(h_referer->value));
} else {
fprintf(aft->file_ctx->fp, "<no referer>");
}
fprintf(aft->file_ctx->fp, " [**] ");
/* method */
if (tx->request_method != NULL) {
PrintRawUriFp(aft->file_ctx->fp,
(uint8_t *)bstr_ptr(tx->request_method),
bstr_len(tx->request_method));
}
fprintf(aft->file_ctx->fp, " [**] ");
/* protocol */
if (tx->request_protocol != NULL) {
PrintRawUriFp(aft->file_ctx->fp,
(uint8_t *)bstr_ptr(tx->request_protocol),
bstr_len(tx->request_protocol));
}
/* ip/tcp header info */
fprintf(aft->file_ctx->fp, " [**] %s:%" PRIu16 " -> %s:%" PRIu16 "\n",
(1-1/2)