Changeset 64fea282d28f812fef7c5622fca0ed39d70ad136
- Timestamp:
- 16/09/06 13:01:24
(2 years ago)
- Author:
- Clément Stenac <zorglub@videolan.org>
- git-committer:
- Clément Stenac <zorglub@videolan.org> 1158404484 +0000
- git-parent:
[f424ec54abf8f25e4107a9219390625f0630cde7]
- git-author:
- Clément Stenac <zorglub@videolan.org> 1158404484 +0000
- Message:
Even if we are asked to wait for data, bail out if all sockets are at EOF.
I'm far from being sure this is the right thing to do, but it allows MMSH to work correctly (it requests some data while the server is closing connection)
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r83f23b6 |
r64fea28 |
|
| 145 | 145 | { |
|---|
| 146 | 146 | size_t i_total = 0; |
|---|
| | 147 | int eof[fdc]; |
|---|
| | 148 | unsigned int i_eof = 0; |
|---|
| | 149 | memset( eof, 0, sizeof( eof ) ); |
|---|
| 147 | 150 | |
|---|
| 148 | 151 | do |
|---|
| … | … | |
| 159 | 162 | if( i_buflen == 0 ) |
|---|
| 160 | 163 | return i_total; // output buffer full |
|---|
| | 164 | |
|---|
| | 165 | if( i_eof == fdc ) |
|---|
| | 166 | return i_total; // all sockets are at EOF |
|---|
| 161 | 167 | |
|---|
| 162 | 168 | delay_ms = 500; |
|---|
| … | … | |
| 277 | 283 | i_buflen -= n; |
|---|
| 278 | 284 | |
|---|
| | 285 | if( n == 0 ) // EOF on socket |
|---|
| | 286 | { |
|---|
| | 287 | unsigned int j; |
|---|
| | 288 | for( j = 0 ; j < i_eof ; j++ ) |
|---|
| | 289 | if( eof[j] == *fdv ) goto end; |
|---|
| | 290 | eof[i_eof++] = *fdv; |
|---|
| | 291 | } |
|---|
| | 292 | end: |
|---|
| 279 | 293 | if( wait_ms == -1 ) |
|---|
| 280 | 294 | { |
|---|