Search squid archive

Re: External C program

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



My replies inline ...

2009/4/30 Julien Philibin <julien@xxxxxxxxxxx>:
> On Wed, Apr 29, 2009 at 9:30 PM, Bharath Raghavendran
> <rbharath25@xxxxxxxxx> wrote:
>> 2009/4/30 Julien Philibin <julien@xxxxxxxxxxx>:
>>> Very interesting Bharath !!!
>>>
>>> What would be your advice to get my program working ?!
>>>
>>> Thanks
>>
>> Unfortunately, I have no advice. I have made external ACLs using C++
>> and know how to handle this using the "cin" stream. With my knowledge
>> of C, the only thing I can think of is using file handling for stdin.
>> I am sure file handling should have ways to detect EOF (I need to
>> search net if you need more details :P )
>>
>
> Could you please show me your skeleton of your C++ Program ? I
> developed mine in C, because I use to develop a lot in C many years
> ago. But I don't mind developing it in C++ as it is not a very
> complicated program (Basically just using the SQL Lib) ...

Here is the code:

#include<iostream>
using namespace std;

int main()
{
    char a[50],b[50];
    cin>>a>>b;
    while(cin)
    {
        // do whatever
        if( condition )
            cout<<"OK\n";
        else
            cout<<"ERR\n";
        cin>>a>>b;
    }
}

You may alternatively use cin.getline(a,49); to get the entire line
into a variable and manually split the different components.

>
>> 127.0.0.1 or "localhost" is a connection to loopback interface which
>> is used to make connections to your own computer. If you have entered
>> the proxy address (assuming you are using squid as a proxy server) as
>> any of these two,
>
> Yes I am using it as proxy server. And it is directly set up in my
> browser's config.
>
>>your computer connects to squid using loopback
>> interface and hence your ip is shown up as 127.0.0.1.
>>
>> You can avoid this by putting your actual IP in the proxy address.
>
> What do you mean ? I checked in my documentation books and I wasn't
> able to find anything about the proxy's address.

I was referring to the proxy address setting in your browser's
configuration (the place where you mention the IP adress and port of
squid). Sorry for being unclear.

>
> And the thing is, it doesn't show up every time with 127.0.0.1, it is
> (apparently) shown as 127.0.0.1 randomly ....

Dunno about this :P

-Bharath

[Index of Archives]     [Linux Audio Users]     [Samba]     [Big List of Linux Books]     [Linux USB]     [Yosemite News]

  Powered by Linux