You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@thrift.apache.org by Mateusz Berezecki <ma...@gmail.com> on 2009/06/20 12:47:23 UTC

getting endpoint address within the processor

Hi,

I'm in a desperate need to know from what IP address is the call to my
thrift server coming from and it seems to me that that's not possible
in Thrift at all !! The level of isolation is so high that I'd have to
hack simply too much stuff. Makes me wonder what use is getHost()
function then ? Apparently it's either a bloat or someone did not
finish something ?

m:thrift m$ grep -r "getHost" *
lib/cpp/src/transport/TSocket.cpp:std::string TSocket::getHost() {
lib/cpp/src/transport/TSocket.h:  std::string getHost();
lib/php/src/transport/TSocket.php:  public function getHost() {
m:thrift m$

Is there _any_ way for me to get the IP from which the request is
coming from or do I really need to hack through tons of code?

I can easily get access to protocol objects by overriding
TProcessor::process(...) method in my custom processor and then just
fall through to real processor to do the processing, but there's
simply no way to get anything useful from the protocol object. I'm
just kind of amazed because of this design that there's no way to do
such a fundamental way of knowing what IP is trying access what. Uh
oh?

I do really hope that I am wrong. Can someone please be so kind and
enlighten me ? I'm really short on time on this one.

best,
Mateusz

Re: getting endpoint address within the processor

Posted by Mateusz Berezecki <ma...@gmail.com>.
Hi Patrick,

Thanks a lot for the very helpful answer!!!!!!

best,
Mateusz

On Sat, Jun 20, 2009 at 2:09 PM, Patrick Schlangen<p....@mac.com> wrote:
> Hi,
>
> I have asked this in May and got a very helpful answer.
> Have a look at the thread, especially at http://mail-archives.apache.org/mod_mbox/incubator-thrift-user/200905.mbox/%3CBD8AA0F1-7820-45E4-BFF5-942F1513A205@dajerade.pl%3E
>
> Patrick
>
>
> Am Samstag 20 Juni 2009 um 12:47PM schrieb "Mateusz Berezecki" <ma...@gmail.com>:
>>Hi,
>>
>>I'm in a desperate need to know from what IP address is the call to my
>>thrift server coming from and it seems to me that that's not possible
>>in Thrift at all !! The level of isolation is so high that I'd have to
>>hack simply too much stuff. Makes me wonder what use is getHost()
>>function then ? Apparently it's either a bloat or someone did not
>>finish something ?
>>
>>m:thrift m$ grep -r "getHost" *
>>lib/cpp/src/transport/TSocket.cpp:std::string TSocket::getHost() {
>>lib/cpp/src/transport/TSocket.h:  std::string getHost();
>>lib/php/src/transport/TSocket.php:  public function getHost() {
>>m:thrift m$
>>
>>Is there _any_ way for me to get the IP from which the request is
>>coming from or do I really need to hack through tons of code?
>>
>>I can easily get access to protocol objects by overriding
>>TProcessor::process(...) method in my custom processor and then just
>>fall through to real processor to do the processing, but there's
>>simply no way to get anything useful from the protocol object. I'm
>>just kind of amazed because of this design that there's no way to do
>>such a fundamental way of knowing what IP is trying access what. Uh
>>oh?
>>
>>I do really hope that I am wrong. Can someone please be so kind and
>>enlighten me ? I'm really short on time on this one.
>>
>>best,
>>Mateusz
>>
>>
>

AW: getting endpoint address within the processor

Posted by Patrick Schlangen <p....@mac.com>.
Hi,

I have asked this in May and got a very helpful answer.
Have a look at the thread, especially at http://mail-archives.apache.org/mod_mbox/incubator-thrift-user/200905.mbox/%3CBD8AA0F1-7820-45E4-BFF5-942F1513A205@dajerade.pl%3E

Patrick

 
Am Samstag 20 Juni 2009 um 12:47PM schrieb "Mateusz Berezecki" <ma...@gmail.com>:
>Hi,
>
>I'm in a desperate need to know from what IP address is the call to my
>thrift server coming from and it seems to me that that's not possible
>in Thrift at all !! The level of isolation is so high that I'd have to
>hack simply too much stuff. Makes me wonder what use is getHost()
>function then ? Apparently it's either a bloat or someone did not
>finish something ?
>
>m:thrift m$ grep -r "getHost" *
>lib/cpp/src/transport/TSocket.cpp:std::string TSocket::getHost() {
>lib/cpp/src/transport/TSocket.h:  std::string getHost();
>lib/php/src/transport/TSocket.php:  public function getHost() {
>m:thrift m$
>
>Is there _any_ way for me to get the IP from which the request is
>coming from or do I really need to hack through tons of code?
>
>I can easily get access to protocol objects by overriding
>TProcessor::process(...) method in my custom processor and then just
>fall through to real processor to do the processing, but there's
>simply no way to get anything useful from the protocol object. I'm
>just kind of amazed because of this design that there's no way to do
>such a fundamental way of knowing what IP is trying access what. Uh
>oh?
>
>I do really hope that I am wrong. Can someone please be so kind and
>enlighten me ? I'm really short on time on this one.
>
>best,
>Mateusz
>
>