[PATCH] Log additional header for the navigation from BlackBarry Device

From: devzero2000 <devzero2000_at_rpm5.org>
Date: Mon, 14 Sep 2009 18:58:37 +0200

I hope this tiny patch can be useful also for other user, so i put here for
review and possible merge if you like.
Thanks in advance

Elia
~~~

 This patch permit to log the additional Header used by BlackBarry
    and to remove these via http_headers squid.conf directive.

    For example

    logformat BlackBerry %ts.%03tu %6tr %>a %Ss/%03Hs %<st %rm %ru %un
%Sh/%<A %mt "%{Rim-device-id}>h" "%{Rim-device-email}>h" /*Log BB
headers*/

    access_log /usr/local/squid/var/logs/access.log BlackBerry bes /*In this
case the logging is redirected based on ACL*/

    ……

    acl bes src XX.XX.XX.XX/255.255.255.255 /*IP Server BES*/

    ……

    header_access Rim-device-email deny all /*Remove header
from GET*/

    header_access Rim-device-id deny all /*Remove header
from GET*/

---
 src/HttpHeader.c |    3 +++
 src/enums.h      |    2 ++
 2 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/src/HttpHeader.c b/src/HttpHeader.c
index 61be2e3..f2dd83d 100644
--- a/src/HttpHeader.c
+++ b/src/HttpHeader.c
@@ -111,6 +111,8 @@ static const HttpHeaderFieldAttrs HeadersAttrs[] =
     {"Referer", HDR_REFERER, ftStr},
     {"Request-Range", HDR_REQUEST_RANGE, ftPRange},    /* usually matches
HDR_RANGE */
     {"Retry-After", HDR_RETRY_AFTER, ftStr},   /* for now (ftDate_1123 or
ftInt!) */
+    {"Rim-device-id", HDR_RIM_DEVICE_ID, ftStr},         /* Header added
for BlackBerry */
+    {"Rim-device-email", HDR_RIM_DEVICE_EMAIL, ftStr},   /* Header added
for BlackBerry */
     {"Server", HDR_SERVER, ftStr},
     {"Set-Cookie", HDR_SET_COOKIE, ftStr},
     {"Transfer-Encoding", HDR_TRANSFER_ENCODING, ftStr},
@@ -221,6 +223,7 @@ static http_hdr_type RequestHeadersArr[] =
     HDR_IF_MATCH, HDR_IF_MODIFIED_SINCE, HDR_IF_NONE_MATCH,
     HDR_IF_RANGE, HDR_MAX_FORWARDS, HDR_PROXY_CONNECTION,
     HDR_PROXY_AUTHORIZATION, HDR_RANGE, HDR_REFERER, HDR_REQUEST_RANGE,
+    HDR_RIM_DEVICE_ID, HDR_RIM_DEVICE_EMAIL,
     HDR_USER_AGENT, HDR_X_FORWARDED_FOR, HDR_TE, HDR_EXPECT
 };
diff --git a/src/enums.h b/src/enums.h
index 694f033..d9cfabf 100644
--- a/src/enums.h
+++ b/src/enums.h
@@ -240,6 +240,8 @@ typedef enum {
     HDR_REQUEST_RANGE,         /* some clients use this, sigh */
     HDR_REFERER,
     HDR_RETRY_AFTER,
+    HDR_RIM_DEVICE_ID,         /* added for Blackberry */
+    HDR_RIM_DEVICE_EMAIL,      /* added for Blackberry */
     HDR_SERVER,
     HDR_SET_COOKIE,
     HDR_UPGRADE,
--
1.5.5.6

Received on Mon Sep 14 2009 - 23:37:22 MDT

This archive was generated by hypermail 2.2.0 : Wed Sep 16 2009 - 12:00:05 MDT