Subject: max URL length in http-gw.c

From: Tor Perkins <[email-masked]>
Date: Fri, 1 Jun 2001 09:08:29 -0700

[To be removed from this list send the message "unsubscribe fwtk-users" in the
BODY of a mail message to [email-masked].]

In http-gw.h there is:

  #define PATH_MAX 1024

PATH_MAX, however, never appears anywhere else in the source code
('doh!).

Instead there are things like this in http-gw.c:

  static char newurl[1200]; /* field for rewriting */

and later:

  cpystr(value,newurl,1022);

Well, mapquest.com can generate an URL > 1022 chars... :P
Probably other sites do as well.

Since this seems a bit messy, I was curious; has anyone already
created a patch for this?

- Tor

---

From: Rick Murphy <[email-masked]>
Date: Fri, 01 Jun 2001 15:59:45 -0400

>PATH_MAX, however, never appears anywhere else in the source code

If memory serves me, it does show up in some .h file on some operating 
system as undefined and this define works around that..

>Probably other sites do as well.

The code that uses the buffer above rewrites anchors - A href="foo" fields 
- which are usually relatively short. In fact, I don't think this code gets 
used if you use http-gw as your web proxy; it's only used if you use 
"http://firewall/http://external-site" type prefixing.

What you're really looking for is the MAX_URL_LEN define. That currently is 
4096 bytes, which should be more than enough.
         -Rick