NancyFx / Nancy

Lightweight, low-ceremony, framework for building HTTP based services on .Net and Mono
http://nancyfx.org
MIT License
7.15k stars 1.46k forks source link

RequestStream does not close stream when buffering to memory #1986

Open tekhedd opened 9 years ago

tekhedd commented 9 years ago

MoveToWritableStream() does not close the old stream after copying it to memory. This leaves HttpListenerRequest's stream unclosed when self-hosting.

phillip-haydon commented 9 years ago

Is this for self hosting without OWIN?

Could we just drop support for non-owin based self hosting?

tekhedd commented 9 years ago

This is for self-hosting, but in any situation where the stream is copied to a memorystream, the incoming RequestStream's input stream is not closed, as it should be, so I would see this as a bug in all situations.

Are you suggesting that your first instinct when fixing a bug I reported that I found while implementing non-OWIN based SelfHosting in my app is to drop support? Awesome. :} I'm feeling great about my decision to use Nancy in this project.

phillip-haydon commented 9 years ago

@tekhedd no. I'm suggesting dropping support for self hosting in Nancy in favour of Owin self hosting which doesn't suffer from this problem. I personally don't know anyone not using non-owin self hosting now-a-days. The old self hosting has other issues besides the one you have raised.

Is there any reason why you can't use the owin host?

tekhedd commented 9 years ago

1) I'm running cross platform here. A stable, widely used OWIN implementation that runs on Mono... would be...which one again?

2) I personally don't know anyone who watches soccer. Why do they keep broadcasting it on the TV?

khellang commented 9 years ago

Katana is both widely used and stable. What's the problem on Mono?