changeset 34785:b89534df8e1e

Detect prematurely closed connection. Then we get a streaming_stopped status but we have a end_pos and have not reached it yet, do not accept it as EOF but instead try reconnection. For example a forced restart of a webserver will usually result in the connection being closed before EOF.
author reimar
date Mon, 23 Apr 2012 18:39:14 +0000
parents d180a74b1a89
children a0b10e46f7e6
files stream/stream.c
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/stream/stream.c	Sun Apr 22 21:52:39 2012 +0000
+++ b/stream/stream.c	Mon Apr 23 18:39:14 2012 +0000
@@ -310,7 +310,8 @@
 #ifdef CONFIG_NETWORKING
     if( s->streaming_ctrl!=NULL && s->streaming_ctrl->streaming_read ) {
       len=s->streaming_ctrl->streaming_read(s->fd, buf, len, s->streaming_ctrl);
-      if (s->streaming_ctrl->status == streaming_stopped_e)
+      if (s->streaming_ctrl->status == streaming_stopped_e &&
+          (!s->end_pos || s->pos == s->end_pos))
         s->eof = 1;
     } else
 #endif