1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-23 08:13:27 +00:00

possible fix for softwareelves' error

This commit is contained in:
Charles Kerr 2008-07-23 19:29:21 +00:00
parent 2d1c6921d2
commit 3d2ccc0002

View file

@ -898,7 +898,10 @@ read_stream(struct stream *stream)
len = stream->content_len - stream->io.total;
/* Read from underlying channel */
n = stream->io_class->read(stream, io_space(&stream->io), len);
if( stream->io_class )
n = stream->io_class->read(stream, io_space(&stream->io), len);
else
n = 0;
if (n > 0)
io_inc_head(&stream->io, n);
@ -936,7 +939,11 @@ write_stream(struct stream *from, struct stream *to)
assert(len > 0);
/* TODO: should be assert on CAN_WRITE flag */
n = to->io_class->write(to, io_data(&from->io), len);
if( to->io_class )
n = to->io_class->write(to, io_data(&from->io), len);
else
n = 0;
to->conn->expire_time = current_time + EXPIRE_TIME;
DBG(("write_stream (%d %s): written %d/%d bytes (errno %d)",
to->conn->rem.chan.sock,