From 8051dc8a6af031b1849ab54bbeb25ecf76eb91d2 Mon Sep 17 00:00:00 2001 From: Ignacio Sanchez Date: Wed, 13 Feb 2013 21:08:06 +0000 Subject: [PATCH] Added modifications suggested by Charles Smutz (https://redmine.openinfosecfoundation.org/issues/602) --- src/log-httplog.c | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/src/log-httplog.c b/src/log-httplog.c index b06bf85807..d3153e6232 100644 --- a/src/log-httplog.c +++ b/src/log-httplog.c @@ -156,7 +156,7 @@ uint32_t getCookieValue(char *rawcookies, uint32_t rawcookies_len, char *cookien while (p < rawcookies + rawcookies_len) { if (cv == NULL && *p == '=') { cv = p + 1; - } else if (cv != NULL && (*p == ' ' || p == rawcookies + rawcookies_len - 1) ) { + } else if (cv != NULL && (*p == ';' || p == rawcookies + rawcookies_len - 1) ) { /* Found end of cookie */ if (strlen(cookiename) == (unsigned int) (cv-cn-1) && strncmp(cookiename, cn, cv-cn-1) == 0) { @@ -196,9 +196,7 @@ static void LogHttpLogCustom(LogHttpLogThread *aft, htp_tx_t *tx, const struct t switch (httplog_ctx->cf_nodes[i]->type){ case LOG_HTTP_CF_LITERAL: /* LITERAL */ - PrintRawUriBuf((char *)aft->buffer->buffer, &aft->buffer->offset, - aft->buffer->size, (uint8_t *)httplog_ctx->cf_nodes[i]->data, - strlen(httplog_ctx->cf_nodes[i]->data)); + MemBufferWriteString(aft->buffer, httplog_ctx->cf_nodes[i]->data); break; case LOG_HTTP_CF_TIMESTAMP: /* TIMESTAMP */ @@ -327,24 +325,6 @@ static void LogHttpLogCustom(LogHttpLogThread *aft, htp_tx_t *tx, const struct t PrintRawUriBuf((char *)aft->buffer->buffer, &aft->buffer->offset, aft->buffer->size, (uint8_t *)bstr_ptr(tx->response_status), bstr_len(tx->response_status)); - /* Redirect? */ - if (tx->response_headers != NULL && - tx->response_status_number > 300 && - tx->response_status_number < 303) - { - htp_header_t *h_location = htp_table_get_c(tx->response_headers, "location"); - if (h_location != NULL) { - MemBufferWriteString(aft->buffer, "("); - datalen = httplog_ctx->cf_nodes[i]->maxlen; - if (datalen == 0 || datalen > bstr_len(h_location->value)) { - datalen = bstr_len(h_location->value); - } - PrintRawUriBuf((char *)aft->buffer->buffer, &aft->buffer->offset, - aft->buffer->size, (uint8_t *)bstr_ptr(h_location->value), - datalen); - MemBufferWriteString(aft->buffer, ")"); - } - } } else { MemBufferWriteString(aft->buffer, LOG_HTTP_CF_NONE); }