Esempio n. 1
0
        static object ContinueResponse(IHttpMessage start, int maxContentLength, IChannelPipeline pipeline)
        {
            if (HttpUtil.IsUnsupportedExpectation(start))
            {
                // if the request contains an unsupported expectation, we return 417
                pipeline.FireUserEventTriggered(HttpExpectationFailedEvent.Default);
                return(ExpectationFailed.RetainedDuplicate());
            }
            else if (HttpUtil.Is100ContinueExpected(start))
            {
                // if the request contains 100-continue but the content-length is too large, we return 413
                if (HttpUtil.GetContentLength(start, -1L) <= maxContentLength)
                {
                    return(Continue.RetainedDuplicate());
                }
                pipeline.FireUserEventTriggered(HttpExpectationFailedEvent.Default);
                return(TooLarge.RetainedDuplicate());
            }

            return(null);
        }
Esempio n. 2
0
 private void CloseOutboundBufferForShutdown(IChannelPipeline pipeline, ChannelOutboundBuffer buffer, Exception cause)
 {
     buffer.FailFlushed(cause, false);
     buffer.Close(cause, true);
     _ = pipeline.FireUserEventTriggered(ChannelOutputShutdownEvent.Instance);
 }
Esempio n. 3
0
 protected override void ExecuteInternal(IChannelPipeline pipeline)
 {
     pipeline.FireUserEventTriggered(null);
 }