diff options
| author | Garrett D'Amore <garrett@damore.org> | 2017-11-05 21:42:51 -0800 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2017-11-05 21:42:51 -0800 |
| commit | 16c4aafc3e36bc41d3e5664bee99c34c21957a6a (patch) | |
| tree | 7fc33bf02f182788782caeec94b16f0890b58e5e /src/platform/windows/win_tcp.c | |
| parent | 5c783d5a183eedd45d702872bfabf28052c9114c (diff) | |
| download | nng-16c4aafc3e36bc41d3e5664bee99c34c21957a6a.tar.gz nng-16c4aafc3e36bc41d3e5664bee99c34c21957a6a.tar.bz2 nng-16c4aafc3e36bc41d3e5664bee99c34c21957a6a.zip | |
fixes #150 IPC error during Bus tests
Diffstat (limited to 'src/platform/windows/win_tcp.c')
| -rw-r--r-- | src/platform/windows/win_tcp.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/platform/windows/win_tcp.c b/src/platform/windows/win_tcp.c index 5e27d4ee..375a72c3 100644 --- a/src/platform/windows/win_tcp.c +++ b/src/platform/windows/win_tcp.c @@ -171,7 +171,7 @@ nni_win_tcp_pipe_finish(nni_win_event *evt, nni_aio *aio) aio->a_count += cnt; while (cnt > 0) { - // If we didn't write the first full iov, + // If we didn't transfer the first full iov, // then we're done for now. Record progress // and move on. if (cnt < aio->a_iov[0].iov_len) { @@ -182,7 +182,7 @@ nni_win_tcp_pipe_finish(nni_win_event *evt, nni_aio *aio) } // We consumed the full iov, so just move the - // remaininng ones up, and decrement count handled. + // remaining ones up, and decrement count handled. cnt -= aio->a_iov[0].iov_len; for (i = 1; i < aio->a_niov; i++) { aio->a_iov[i - 1] = aio->a_iov[i]; @@ -191,10 +191,15 @@ nni_win_tcp_pipe_finish(nni_win_event *evt, nni_aio *aio) aio->a_niov--; } - if (aio->a_niov > 0) { + while (aio->a_niov > 0) { // If we have more to do, submit it! - nni_win_event_resubmit(evt, aio); - return; + if (aio->a_iov[0].iov_len > 0) { + nni_win_event_resubmit(evt, aio); + return; + } + for (i = 1; i < aio->a_niov; i++) { + aio->a_iov[i - 1] = aio->a_iov[i]; + } } } |
