AF:
NF:0
PS:10
SRH:1
SFN:
DSR:
MID:<20080618153747.13b9b687@ripper.onstor.net>
CFG:
PT:0
S:andy.sharp@onstor.com
RQ:
SSV:onstor-exch02.onstor.net
NSV:
SSH:
R:<ian.brown@onstor.com>
MAID:1
X-Sylpheed-Privacy-System:
X-Sylpheed-Sign:0
SCF:#mh/Mailbox/sent
RMID:#imap/andys@onstor.net@onstor-exch02.onstor.net/INBOX	41288	B5B84153-7147-4194-A015-780D264D531D@onstor.com
X-Sylpheed-End-Special-Headers: 1
Date: Wed, 18 Jun 2008 15:38:03 -0700
From: Andrew Sharp <andy.sharp@onstor.com>
To: Ian Brown <ian.brown@onstor.com>
Subject: Re: socat source
Message-ID: <20080618153803.40313383@ripper.onstor.net>
In-Reply-To: <B5B84153-7147-4194-A015-780D264D531D@onstor.com>
References: <20080613132703.3ed4b1eb@ripper.onstor.net>
 <B5B84153-7147-4194-A015-780D264D531D@onstor.com>
Organization: Onstor
X-Mailer: Sylpheed-Claws 2.6.0 (GTK+ 2.8.20; x86_64-pc-linux-gnu)
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit

On Mon, 16 Jun 2008 18:56:50 -0700 Ian Brown <ian.brown@onstor.com>
wrote:

> After looking at this source for socat 1.4.3.1, there are 4 changes  
> that we will need from the bsd version of socat, on the linux version:
> 
> 1)  the -T option is missing, we need that to timeout connections

Hi Ian,

As I think I mentioned before, we're going away from the model of
customizing common upstream packages unless we can't possibly avoid
it.  Some examples would be if there is a bug we must fix which can't be
worked around (and then the change should be submitted upstream), or if
a command or package has to vsvr aware.  Therefore we won't be using the
-T option, because we don't get anything useful from it and because it
doesn't exist in the version we are currently using in Linux. Hence my
changes to support.sh that implement timeout, but with error handling
and logging capabilities.

> 2)  in xioclose.c :
> <       if (Kill(pipe->para.exec.pid, SIGTERM) < 0) {
> ---
>  >                    if (Kill(pipe->para.exec.pid, SIGUSR2) < 0) {
>  >                    // Ianb: I changed this to USR2 from SIGTERM  
> because while I
>  >                    // was using socat for support.sh when the  
> webserver would
>  >                    // close the connection (for example when I  
> asked for the
>  >                    // wrong url and got a "404 Not Found" error,  
> then socat
>  >                    // would send this SIGTERM which would kill
>  > the  
> parent
>  >                    // process that called support.sh as well,
>  > which  
> for the
>  >                    // customer is nfxsh, which means they get  
> logged out.  The
>  >                    // default action for SIGUSR2 (if it is not  
> caught) is to
>  >                    // terminate the process, but for some reason  
> that I have not
>  >                    // investigated yet it does not also kill the  
> parent process,
>  >                    // which is the behavior that we want.
>  >                    //
>  >                    //if (Kill(pipe->para.exec.pid, SIGTERM) < 0) {

Signals don't get posted to parent threads, so there must have been
something else going on there.  We should nail that down and fix it if
it hasn't been fixed already.

> 3) xio-openssl.c
> 
> errors are not checked on the ssl sessions, we need these fixes so
> we dont have a regression

Not sure what you mean, can you be more specific?

> 4)  I had made some changes to the ERROR logging to make it in line  
> with the format of the elog, and support.sh matches on these  
> strings...  I probably should not have done this, but support.sh
> needs to be tested with the default version.

I really am not a fan of the error message scraping logic in support.sh.
My gut tells me there has to be a better way of handling this.  Perhaps
just send whatever error message socat spews out to elog or do some
finer analysis of exit codes or just pare down the possible error
messages to one or two which wouldn't be the end of the world.  KIS.

Let's grab some time and discuss.

Cheers,

a


> 
> - Ian
> 
> 
> 
> 
> On Jun 13, 2008, at 1:27 PM, Andrew Sharp wrote:
> 
> ~andys/debs-src/socat/socat-1.4.3.1
> 
> http://ripper/~andys/debs-src/socat/socat-1.4.3.1/
> 
