soup-body-input-stream: update priv->eof when skipping
authorSergio Villar Senin <svillar@igalia.com>
Fri, 18 Jan 2013 18:06:48 +0000 (19:06 +0100)
committerSergio Villar Senin <svillar@igalia.com>
Fri, 18 Jan 2013 18:34:04 +0000 (19:34 +0100)
We must update the priv->eof field in the skip() operation as we do in
read(). This bug was causing redirects not to finish because the
SoupBodyInputStream was creating a pollable source that will never issue
anything instead of a plain timeout source.

https://bugzilla.gnome.org/show_bug.cgi?id=692026

libsoup/soup-body-input-stream.c

index fff0780..939753a 100644 (file)
@@ -286,7 +286,9 @@ soup_body_input_stream_skip (GInputStream *stream,
                                       MIN (count, priv->read_length),
                                       cancellable, error);
 
-       if (skipped != -1)
+       if (skipped == 0)
+               priv->eof = TRUE;
+       else if (skipped > 0)
                priv->pos += skipped;
 
        return skipped;