[Iiop-net-commits] IIOPNet/IIOPChannel IIOPFormatter.cs,1.10,1.11
Brought to you by:
dullmann,
patrik_reali
From: Dominic U. <dul...@us...> - 2004-11-20 10:45:05
|
Update of /cvsroot/iiop-net/IIOPNet/IIOPChannel In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv943/IIOPChannel Modified Files: IIOPFormatter.cs Log Message: keeps response transport headers, if passed back by a sink later in the sink chain Index: IIOPFormatter.cs =================================================================== RCS file: /cvsroot/iiop-net/IIOPNet/IIOPChannel/IIOPFormatter.cs,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** IIOPFormatter.cs 17 Nov 2004 16:36:55 -0000 1.10 --- IIOPFormatter.cs 20 Nov 2004 10:44:54 -0000 1.11 *************** *** 44,72 **** ! /// <summary>used to store relevant data for async response processing</summary> ! internal class AsyncProcessingData { ! private GiopConnectionDesc m_conDesc; ! private IMessage m_reqMsg; ! internal AsyncProcessingData(IMessage reqMsg, ! GiopConnectionDesc conDesc) { ! m_reqMsg = reqMsg; ! m_conDesc = conDesc; ! } ! internal IMessage RequestMsg { ! get { ! return m_reqMsg; ! } } ! internal GiopConnectionDesc ConDesc { ! get { ! return m_conDesc; ! } } - } /// <summary> --- 44,73 ---- ! /// <summary>used to store relevant data for async response processing</summary> ! internal class AsyncProcessingData { ! private GiopConnectionDesc m_conDesc; ! private IMessage m_reqMsg; ! internal AsyncProcessingData(IMessage reqMsg, ! GiopConnectionDesc conDesc) { ! m_reqMsg = reqMsg; ! m_conDesc = conDesc; ! } ! internal IMessage RequestMsg { ! get { ! return m_reqMsg; } + } ! internal GiopConnectionDesc ConDesc { ! get { ! return m_conDesc; } } + + } + /// <summary> *************** *** 349,356 **** private void SerialiseResponse(IServerResponseChannelSinkStack sinkStack, IMessage requestMsg, GiopConnectionDesc conDesc, IMessage msg, ! out ITransportHeaders headers, out Stream stream) { uint requestId = Convert.ToUInt32(requestMsg.Properties[SimpleGiopMsg.REQUEST_ID_KEY]); GiopVersion version = (GiopVersion)requestMsg.Properties[SimpleGiopMsg.GIOP_VERSION_KEY]; ! headers = new TransportHeaders(); headers[GiopConnectionDesc.SERVER_TR_HEADER_KEY] = conDesc; // get the stream into which the message should be serialied from a stream handling --- 350,359 ---- private void SerialiseResponse(IServerResponseChannelSinkStack sinkStack, IMessage requestMsg, GiopConnectionDesc conDesc, IMessage msg, ! ref ITransportHeaders headers, out Stream stream) { uint requestId = Convert.ToUInt32(requestMsg.Properties[SimpleGiopMsg.REQUEST_ID_KEY]); GiopVersion version = (GiopVersion)requestMsg.Properties[SimpleGiopMsg.GIOP_VERSION_KEY]; ! if (headers == null) { ! headers = new TransportHeaders(); ! } headers[GiopConnectionDesc.SERVER_TR_HEADER_KEY] = conDesc; // get the stream into which the message should be serialied from a stream handling *************** *** 369,373 **** GiopConnectionDesc conDesc, out IMessage responseMsg, ! out ITransportHeaders headers, out Stream stream) { uint requestId = Convert.ToUInt32(requestMsg.Properties[SimpleGiopMsg.REQUEST_ID_KEY]); GiopVersion version = (GiopVersion)requestMsg.Properties[SimpleGiopMsg.GIOP_VERSION_KEY]; --- 372,376 ---- GiopConnectionDesc conDesc, out IMessage responseMsg, ! ref ITransportHeaders headers, out Stream stream) { uint requestId = Convert.ToUInt32(requestMsg.Properties[SimpleGiopMsg.REQUEST_ID_KEY]); GiopVersion version = (GiopVersion)requestMsg.Properties[SimpleGiopMsg.GIOP_VERSION_KEY]; *************** *** 407,411 **** deserReqMsg = DeserialiseRequest(requestStream, requestHeaders, conDesc); // processing may be done asynchronous, therefore push this sink on the stack to process a response async ! AsyncProcessingData asyncData = new AsyncProcessingData(deserReqMsg, conDesc); sinkStack.Push(this, asyncData); --- 410,415 ---- deserReqMsg = DeserialiseRequest(requestStream, requestHeaders, conDesc); // processing may be done asynchronous, therefore push this sink on the stack to process a response async ! AsyncProcessingData asyncData = ! new AsyncProcessingData(deserReqMsg, conDesc); sinkStack.Push(this, asyncData); *************** *** 418,423 **** sinkStack.Pop(this); // not async // send the response ! SerialiseResponse(sinkStack, deserReqMsg, conDesc, responseMsg, ! out responseHeaders, out responseStream); break; case ServerProcessing.Async: --- 422,427 ---- sinkStack.Pop(this); // not async // send the response ! SerialiseResponse(sinkStack, deserReqMsg, conDesc, responseMsg, ! ref responseHeaders, out responseStream); break; case ServerProcessing.Async: *************** *** 440,444 **** SerialiseExceptionResponse(deserEx.Reason, deserEx.RequestMessage, conDesc, out responseMsg, ! out responseHeaders, out responseStream); return ServerProcessing.Complete; } catch (Exception e) { --- 444,448 ---- SerialiseExceptionResponse(deserEx.Reason, deserEx.RequestMessage, conDesc, out responseMsg, ! ref responseHeaders, out responseStream); return ServerProcessing.Complete; } catch (Exception e) { *************** *** 449,453 **** if (deserReqMsg != null) { SerialiseExceptionResponse(e, deserReqMsg, conDesc, ! out responseMsg, out responseHeaders, out responseStream); } else { --- 453,457 ---- if (deserReqMsg != null) { SerialiseExceptionResponse(e, deserReqMsg, conDesc, ! out responseMsg, ref responseHeaders, out responseStream); } else { *************** *** 465,474 **** IMessage requestMsg = asyncData.RequestMsg; SerialiseResponse(sinkStack, requestMsg, asyncData.ConDesc, msg, ! out headers, out stream); } catch (Exception e) { // serialise the exception SerialiseExceptionResponse(e, (IMessage)state, asyncData.ConDesc, ! out msg, out headers, out stream); } sinkStack.AsyncProcessResponse(msg, headers, stream); // pass further on to the stream handling sinks --- 469,478 ---- IMessage requestMsg = asyncData.RequestMsg; SerialiseResponse(sinkStack, requestMsg, asyncData.ConDesc, msg, ! ref headers, out stream); } catch (Exception e) { // serialise the exception SerialiseExceptionResponse(e, (IMessage)state, asyncData.ConDesc, ! out msg, ref headers, out stream); } sinkStack.AsyncProcessResponse(msg, headers, stream); // pass further on to the stream handling sinks |