/ Zope / Apsis / Pound Mailing List / Archive / 2009 / 2009-04 / RE: [Pound Mailing List] location headers problems

[ << ] [ >> ]

[ Strange problem with Subversion behind Pound / ... ] [ URGENT|need help in POUND installation / Sunil ... ]

RE: [Pound Mailing List] location headers problems
"SBR" <sbr(at)rlfans.com>
2009-04-12 16:25:35 [ FULL ]
Hi,

I've just investigated some similar issues I've been having with pound not
rewriting the location when my backend appends its port to the correct
hostname when doing a redirect. I noticed the following if statement in
need_rewrite (svc.c line 742) which seems to have mismatched brackets:

        if(memcmp(&be_addr.sin_addr.s_addr, &in_addr.sin_addr.s_addr,
sizeof(in_addr.sin_addr.s_addr)) == 0
        && (memcmp(&be_addr.sin_port, &in_addr.sin_port,
sizeof(in_addr.sin_port) != 0
            || strcasecmp(proto, (lstn->ctx == NULL)? "http": "https")))) {

The second line is missing a closing bracket after the sizeof so the second
memcmp call is actually:

memcmp(&be_addr.sin_port, &in_addr.sin_port, sizeof(in_addr.sin_port)
!= 0
|| strcasecmp(proto, (lstn->ctx == NULL)? "http": "https")))

Changing this if to the following fixed the port on my redirects:

        if(memcmp(&be_addr.sin_addr.s_addr, &in_addr.sin_addr.s_addr,
sizeof(in_addr.sin_addr.s_addr)) == 0
        && (memcmp(&be_addr.sin_port, &in_addr.sin_port,
sizeof(in_addr.sin_port)) != 0
            || strcasecmp(proto, (lstn->ctx == NULL)? "http": "https"))) {

It looks like there is a similar issue for IPv6 redirects on line 754.

Regards,
Andrew

-----Original Message-----
From: Dave Steinberg [mailto:dave(at)redterror.net] 
Sent: 20 March 2009 15:04
To: pound(at)apsis.ch
Subject: Re: [Pound Mailing List] location headers problems
[...]
the[...]

This sounds like a problem with your backend.  Does the same thing 
happen if you connect directly and issue those same GET commands?

[...]

Re: [Pound Mailing List] location headers problems
Emilio Campos <emilio.campos.martin(at)gmail.com>
2009-04-13 17:47:44 [ FULL ]
A lot of thanks SBR, I solved this problem downgrade version to 2.3.2 but i
m going to upgrade with this solution

1k thanks ;)

2009/4/12 SBR <sbr(at)rlfans.com>
[...]
Attachments:  
text.html text/html 4062 Bytes

MailBoxer