RE: [Pound Mailing List] Location comarision with backend address & host

Raj Kishore1/CHN/TCS <raj.kishore1-/[email protected]>
Newsgroups gmane.comp.web.pound.general
Message-ID <[email protected]>
Hi,

When External Client sends a request, it is only going to be proxy address. Why
is there a condition to compare the location header address to that of backend address list?
Please clarify!!

for(i = 0; i < grp->tot_pri; i++)
	    if(memcmp(&grp->backend_addr[i].addr.sin_addr, &addr.sin_addr, sizeof(addr.sin_addr)) == 0
	    && memcmp(&grp->backend_addr[i].addr.sin_port, &addr.sin_port, sizeof(addr.sin_port)) == 0)
		    return 1;
    return 0;

 
Thanks
Raj

----- Original Message -----
From: Joe Gooch <[email protected]>
To: '[email protected]' <[email protected]>
Sent: Wed, 06 Mar 2013 20:06:24 +0530 (IST)
Subject: RE: [Pound Mailing List] Location comarision with backend address & host



is_be is used for location rewriting.  If the backend throws a redirect, and the address is one of our known backends, then we can rewrite the redirect to point to the proxy address. (as you usually wouldn’t want the client to try to hit the backend directly, and it’s even possible it can’t hit the backend directly because it might be a private address)
 
Why would you want to remove this?
 
Joe
 
 
 



From: Raj Kishore1/CHN/TCS [mailto:raj.kishore1-/[email protected]] 
Sent: Wednesday, March 06, 2013 3:48 AM
To: [email protected]
Subject: [Pound Mailing List] Location comarision with backend address & host
 
Hi,
In pound 1.9 version, function "is_be" function in  file svc.c is written to find if a host is in our list of back-ends. Could anyone explain the need of such comparision of the location address with list of backend address and with to_host . What could be the effect in pound if this function is removed?
Comparision:-
if(memcmp(&to_host->sin_addr, &addr.sin_addr, sizeof(addr.sin_addr)) == 0
    && memcmp(&to_host->sin_port, &addr.sin_port, sizeof(addr.sin_port)) == 0)
    return 1;
    for(i = 0; i < grp->tot_pri; i++)
    if(memcmp(&grp->backend_addr[i].addr.sin_addr, &addr.sin_addr, sizeof(addr.sin_addr)) == 0
    && memcmp(&grp->backend_addr[i].addr.sin_port, &addr.sin_port, sizeof(addr.sin_port)) == 0)
    return 1;
    return 0;


Thanks
Raj Kishore
=====-----=====-----=====
Notice: The information contained in this e-mail
message and/or attachments to it may contain 
confidential or privileged information. If you are 
not the intended recipient, any dissemination, use, 
review, distribution, printing or copying of the 
information contained in this e-mail message 
and/or attachments to it are strictly prohibited. If 
you have received this communication in error, 
please notify us by reply e-mail or telephone and 
immediately and permanently delete the message 
and any attachments. Thank you
--
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.