Issue With HTTP Redirects

Jonathan Houser <[email protected]>
Newsgroups gmane.comp.mobile.kannel.devel
Message-ID <[email protected]>
      Ok, I'll give the exact setup and what this is fixing in case any 
of it matters for debugging.  The issue is that some phones have a 
hardcoded WAP homepage of 'http://www.openwave.com/' in them.  Since we 
host multiple carriers, I have a two part fix to get around this.  The 
first is a couple of 'map-url' entries in my Kannel config:

map-url-max = 2
map-url-0 = http://www.openwave.com http://xxx.xxx.xxx/servlets/wap
map-url-1 = www.openwave.com http://xxx.xxx.xxx/servlets/wap

      The second part is a mod_rewrite in my Apache as I'm using it as 
an HTTP proxy, also in the Kannel config:

http-proxy-host = localhost
http-proxy-port = 9401

      The mod_rewrite issues a 302 re-direct for...

http://xxx.xxx.xxx/servlets/wap

      ...to go to...

http://xxx.xxx.xxx/carrier/xxx.php

      This works in my old version of Kannel that I am still running 
(due to this problem -- the FD leak has been fixed obviously).  In the 
latest from CVS, I got the following debug output lines:

2005-04-06 11:09:43 [30337] [16] DEBUG: HTTP: Status line: <HTTP/1.1 302 
Found>
2005-04-06 11:09:43 [30337] [16] DEBUG: Failed reading entity
2005-04-06 11:09:43 [30337] [16] ERROR: Couldn't fetch 
<http://xxx.xxx.xxx/servlets/wap>
2005-04-06 11:09:43 [546] [8] ERROR: WSP: HTTP lookup failed, oops.
2005-04-06 11:09:43 [546] [8] WARNING: WSP: Content type <text/plain> 
not supported by client, deleting body.
2005-04-06 11:09:43 [2417] [1] DEBUG: WSP: machine 0x81ba070, state 
CONNECTED, event S-MethodResult.req
2005-04-06 11:09:43 [2417] [1] DEBUG: WSP: method 1, state PROCESSING, 
event S-MethodResult.req
2005-04-06 11:09:43 [2417] [1] DEBUG: WSP: Mapping `text/plain', WSP 1.2 
to 0x0003.
2005-04-06 11:09:43 [2417] [1] DEBUG: WSP: Mapping `Content-Length', WSP 
1.3 to 0x000d.
2005-04-06 11:09:43 [2417] [1] DEBUG: WSP: Mapping `Content-Type', WSP 
1.3 to 0x0011.
2005-04-06 11:09:43 [2417] [1] DEBUG: WSP 0/1: New method state REPLYING
2005-04-06 11:09:43 [2417] [1] DEBUG: WSP 0: New state CONNECTED
2005-04-06 11:09:43 [19069] [6] DEBUG: WTP: resp_machine 1, state 
RESULT_WAIT, event TR-Result.req.
2005-04-06 11:09:43 [19069] [6] DEBUG: WTP: begin_sar_result(): data len = 6
2005-04-06 11:09:43 [19069] [6] DEBUG: WTP: dispath_to_wdp(): psn = 0
2005-04-06 11:09:43 [19069] [6] DEBUG: WTP 1: New state RESULT_RESP_WAIT

      I started to track it down in the code, which the error 'Failed 
reading entity' is from 'gwlib/http.c:1039', but figured you guys would 
probably be able to narrow it down more quickly.  I'll keep working from 
my side however.  Thanks as always!

Jon
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.