mirror of https://github.com/adamdruppe/arsd.git
connection closed exception
This commit is contained in:
parent
40837ffeed
commit
6330a7157d
8
cgi.d
8
cgi.d
|
@ -495,6 +495,12 @@ mixin template ForwardCgiConstructors() {
|
||||||
this(BufferedInputRange ir, bool* closeConnection) { super(ir, closeConnection); }
|
this(BufferedInputRange ir, bool* closeConnection) { super(ir, closeConnection); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// thrown when a connection is closed remotely while we waiting on data from it
|
||||||
|
class ConnectionClosedException : Exception {
|
||||||
|
this(string message, string file = __FILE__, size_t line = __LINE__, Throwable next = null) {
|
||||||
|
super(message, file, line, next);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
version(Windows) {
|
version(Windows) {
|
||||||
|
@ -3968,7 +3974,7 @@ class BufferedInputRange {
|
||||||
*/
|
*/
|
||||||
void popFront(size_t maxBytesToConsume = 0 /*size_t.max*/, size_t minBytesToSettleFor = 0, bool skipConsume = false) {
|
void popFront(size_t maxBytesToConsume = 0 /*size_t.max*/, size_t minBytesToSettleFor = 0, bool skipConsume = false) {
|
||||||
if(sourceClosed)
|
if(sourceClosed)
|
||||||
throw new Exception("can't get any more data from a closed source");
|
throw new ConnectionClosedException("can't get any more data from a closed source");
|
||||||
if(!skipConsume)
|
if(!skipConsume)
|
||||||
consume(maxBytesToConsume);
|
consume(maxBytesToConsume);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue