Re: [squid-users] Plz help - Redirection not happening

From: Henrik Nordstrom <hno@dont-contact.us>
Date: 12 Sep 2003 08:46:09 +0200

fre 2003-09-12 klockan 08.29 skrev Deepa D:

> interacting with another server(using its SDK).During
> this process , one SDK function is writing some
> comments to the stdout(We can't alter that function
> though).These are being read by the squid proxy and
> the redirection is not happening as desired.

Then change your program to redirect stdout to stderr before
initializing the SDK, keeping the original stdout fdhandle for return
values to Squid only.

If on unix this exercise is as simple as follows

   // create another out filehandle from stdout
   FILE *out = fdopen(dup(1), "w");

   // redirect stdout to stderr
   dup2(2, 1);

   // Disable buffering on output channel
   setbuf(out, NULL);

then write your redirector output to out instead of stdout.

Regards
Henrik

   

-- 
Donations welcome if you consider my Free Squid support helpful.
https://www.paypal.com/xclick/business=hno%40squid-cache.org
Please consult the Squid FAQ and other available documentation before
asking Squid questions, and use the squid-users mailing-list when no
answer can be found. Private support questions is only answered
for a fee or as part of a commercial Squid support contract.
If you need commercial Squid support or cost effective Squid and
firewall appliances please refer to MARA Systems AB, Sweden
http://www.marasystems.com/, info@marasystems.com
Received on Fri Sep 12 2003 - 00:46:20 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 17:19:40 MST