synapse-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Kalnichevski <ol...@apache.org>
Subject Re: http-transport-bug fixed
Date Sat, 08 Mar 2008 18:43:46 GMT

On Sun, 2008-03-09 at 01:12 +0800, xuhongbo wrote:
> Hi, Oleg:
>     I feels sorry that I have not expressed clearly. 
> > 
> > (1) Status of what request are you checking? Client to synapse?
> 
> No , not client to synapse, but the request synapse relayed to axisServer
> axisClient--->synapse--->axisServer
> 
> I just add code to check the status of http-request relayed from synapse to axisServer
. 
> 
> More details about how to do this is :
> In NHttpClientHandler error report callback, I  check if the request sent from synapse
to axisServer has finished.Here "finish" means received response back from axisServer;
> 
> If finished , synapse will ommit the exception, and just simply close connection. But
if not finish , we will not only close http connection, but also we should send back a error-message-context
to axisClient. 
> 

Ok. I see.

> 
> Yes, httpCore is and should be a generic http protocol library. And NHttpClientHandler
should generally indicate event of protocol level . and it does works very well. 
> 
> But my matter is while  exception occured, I must make sure if the request relayed to
axisServer has finished.
>  If it's not finished, synapse should send a failure-message-context back to axisClient
 to indicate the failure.
> ---------------------------------------------------------------------------------------------------------------------
> 
> and after I writted the patch, I found that all the patch code's work is just detecting
if a http-request send to http-server has received a response , when http connection cannot
be used any more (due to exception or time-out). 
> 
> and the patch code looks  very awkward ... ...; so I think if http-core could support
Callback to detecting http-request status(yet, I think maybe SessionRequestCallback could
do this. (I am not sure about this). but in my test, SessionRequestCallback can only report
limited error).
> 
> 

SessionRequestCall is certainly the wrong place as it has absolutely
nothing to do with HTTP requests. 

I suggested an improvement to the Synapse's non-blocking HTTP transport
a while ago, which would make it easier to maintain a conversational
state between client bound and server bound connections:

https://issues.apache.org/jira/browse/SYNAPSE-156

Anyways, feel free to submit a patch with the changes you propose to be
incorporated into HttpCore NIO.

Oleg

> 
> > 
> > (3) You can use the state of the encoder / decoder passed in the
> > NHttpClientHandler#outputReady() / NHttpServiceHandler#inputReady()
> > events to determine whether a request has been fully sent / received.
> > 
> > Hope this helps somewhat
> > 
> > Oleg
> >> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org


Mime
View raw message