Fix mismatch in size of used buffer to prevent an infinite loop

A mismatch in the size of the used buffer, between reading and then further writing caused an infinite loop and big files(1Mb, 10Mb etc) could not be downloaded through the lighttpd web service using mod_glusterfs. This is because the big file which is broken up into chunks, has a read and a subsequent write.

Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
This commit is contained in:
Pavan Sondur 2009-05-27 10:39:38 +00:00 committed by Anand V. Avati
parent b84ab58d8c
commit 23976ec1e8

View File

@ -270,7 +270,7 @@ mod_glusterfs_read_async (server *srv, connection *con, chunk *glusterfs_chunk)
check += buf->vector[i].iov_len;
nw_write_buf->used = buf->vector[i].iov_len;
nw_write_buf->used = buf->vector[i].iov_len + 1;
nw_write_buf->size = buf->vector[i].iov_len;
nw_write_buf->ptr = buf->vector[i].iov_base;