]> code.citadel.org Git - citadel.git/commitdiff
* Track whether user-agent is a WAP gateway
authorMichael Hampton <io_error@uncensored.citadel.org>
Sat, 11 May 2002 22:46:19 +0000 (22:46 +0000)
committerMichael Hampton <io_error@uncensored.citadel.org>
Sat, 11 May 2002 22:46:19 +0000 (22:46 +0000)
webcit/ChangeLog
webcit/webcit.c
webcit/webcit.h

index 4ac9206d9eef2c0c01b314253cbf31e365b6c669..b89392e17dbd7822e4f374e53f1f8c6c2de945ac 100644 (file)
@@ -1,4 +1,7 @@
 $Log$
+Revision 323.34  2002/05/11 22:46:19  error
+* Track whether user-agent is a WAP gateway
+
 Revision 323.33  2002/05/11 15:35:07  error
 * webcit.c: add MIME types for WAP/WML
 
@@ -815,3 +818,4 @@ Sun Dec  6 19:50:55 EST 1998 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
 
 1998-12-03 Nathan Bryant <bryant@cs.usm.maine.edu>
        * webserver.c: warning fix
+
index 12d6d5f33af26158805f93c145d95ecc473ca8b7..348018e6efa2463340553035f0f93a7ce286f17f 100644 (file)
@@ -751,6 +751,8 @@ void session_loop(struct httprequest *req)
        WC->upload_length = 0;
        WC->upload = NULL;
 
+       WC->is_wap = 0;
+
        hptr = req;
        if (hptr == NULL) return;
 
@@ -776,6 +778,10 @@ void session_loop(struct httprequest *req)
                else if (!strncasecmp(buf, "User-agent: ", 12)) {
                        strcpy(user_agent, &buf[12]);
                }
+               /* Only WAP gateways explicitly name this content-type */
+               else if (strstr(buf, "text/vnd.wap.wml")) {
+                       WC->is_wap = 1;
+               }
        }
 
        if (ContentLength > 0) {
index 1e4e2d00b4ba4a4925288908757c5343595e8405..f5c4babceda2533e5644a41708f63a430d20e915 100644 (file)
@@ -147,6 +147,7 @@ struct wcsession {
        char reply_to[512];             /* reply-to address */
        long msgarr[1024];              /* for read operations */
        int fake_frames;
+       int is_wap;                     /* Client is a WAP gateway */
        struct urlcontent *urlstrings;
        int HaveExpressMessages;        /* Nonzero if incoming msgs exist */
        struct wcsubst *vars;