]> git.tuebingen.mpg.de Git - paraslash.git/commit
dccp_recv: Use para_readv() instead of recv_bin_buffer().
authorAndre Noll <maan@systemlinux.org>
Sat, 13 Feb 2010 12:12:47 +0000 (13:12 +0100)
committerAndre Noll <maan@systemlinux.org>
Sat, 13 Feb 2010 12:12:47 +0000 (13:12 +0100)
commit9e44ee868aaddc68f2cb18bef0d73093e889b810
treefd47fda65b404005b06ae91956201f3b6cb3e685
parentcda5b2048d7b5455098bb1462171d80fa04e773a
dccp_recv: Use para_readv() instead of recv_bin_buffer().

When the end of the buffer pool area is reached, the old code ended up calling recv()
with a buffer size smaller than a full datagram. This results in data being lost
because the remaining part of the datagram will be discarded rather than returned
at the next call to recv().

By using the new btr_pool_get_buffers() we obtain two buffers in this case, a small
one pointing to the end of the area and a larger one pointing to the area start. Passing
both buffers to para_readv() instead of using recv_bin_buffer() receives the full
datagram and therefore avoids the above mentioned loss of data.
dccp_recv.c