This ensures that tq_receive() will always return EOF after all streams were receive-finished, even though the sending side might not have closed them yet. This may allow the receiver to avoid manually tracking which streams it has already closed.
Unified · Split
| @@ -177,7 +177,7 @@ static int receive_locked(ThreadQueue *tq, int *stream_idx, · 176 unmodified lines | ||
| 177 | 177 | } |
| 178 | 178 | |
| 179 | 179 | for (unsigned int i = 0; i < tq->nb_streams; i++) { |
| 180 | − if (!(tq->finished[i] & FINISHED_SEND)) | |
| 180 | + if (!tq->finished[i]) | |
| 181 | 181 | continue; |
| 182 | 182 | |
| 183 | 183 | /* return EOF to the consumer at most once for each stream */ |