Hi Oleg

I think I found the issue in DefaultNHttpServerConnection:produceOutput(). If the content encoder has completed, I think you should flush the buffer before you reset as follows, but I leave this upto you to verify.

thanks
asankha

    public void produceOutput(final NHttpServiceHandler handler) {
        try {
            if (this.outbuf.hasData()) {
                this.outbuf.flush(this.session.channel());
            }
            if (!this.outbuf.hasData()) {
                if (this.closed) {
                    this.session.close();
                } else {
                    if (this.contentEncoder != null) {
                        handler.outputReady(this, this.contentEncoder);
                        if (this.contentEncoder.isCompleted()) {
this.outbuf.flush(this.session.channel());
                            resetOutput();
                        }
                    }
                }
                if (this.contentEncoder == null) {
                    this.session.clearEvent(EventMask.WRITE);
                }
            }
        } catch (IOException ex) {
            handler.exception(this, ex);
        } finally {
            // Finally set the buffered output flag
            this.hasBufferedOutput = this.contentEncoder != null && this.outbuf.hasData();
        }
    }

--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to