Changeset ed9144bac360c3c29d92fe8f6cb8195680fdeb52
- Timestamp:
- 22/12/07 10:10:56
(10 months ago)
- Author:
- Rémi Denis-Courmont <rem@videolan.org>
- git-committer:
- Rémi Denis-Courmont <rem@videolan.org> 1198314656 +0000
- git-parent:
[f9ff5b64b419eccc3d746aa93ff22d49eef4c3bd]
- git-author:
- Rémi Denis-Courmont <rem@videolan.org> 1198314656 +0000
- Message:
Revert [23768] and [23768]. Fix dead lock whenever reading from the network.
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r4c4ad24 |
red9144b |
|
| 257 | 257 | net_ReadInner (vlc_object_t *restrict p_this, unsigned fdc, const int *fdv, |
|---|
| 258 | 258 | const v_socket_t *const *restrict vsv, |
|---|
| 259 | | uint8_t *restrict p_buf, size_t i_buflen, vlc_bool_t waitall, |
|---|
| 260 | | int timeout) |
|---|
| | 259 | uint8_t *restrict p_buf, size_t i_buflen, vlc_bool_t waitall) |
|---|
| 261 | 260 | { |
|---|
| 262 | 261 | size_t i_total = 0; |
|---|
| … | … | |
| 283 | 282 | } |
|---|
| 284 | 283 | |
|---|
| 285 | | switch (poll (ufd, fdc, timeout ? timeout : 500)) |
|---|
| | 284 | switch (poll (ufd, fdc, 500)) |
|---|
| 286 | 285 | { |
|---|
| 287 | 286 | case -1: |
|---|
| … | … | |
| 289 | 288 | |
|---|
| 290 | 289 | case 0: // timeout |
|---|
| 291 | | if( timeout ) return i_total; |
|---|
| 292 | 290 | continue; |
|---|
| 293 | 291 | } |
|---|
| … | … | |
| 402 | 400 | return net_ReadInner( p_this, 1, &(int){ fd }, |
|---|
| 403 | 401 | &(const v_socket_t *){ p_vs }, |
|---|
| 404 | | buf, len, b_retry, 0 ); |
|---|
| | 402 | buf, len, b_retry ); |
|---|
| 405 | 403 | } |
|---|
| 406 | 404 | |
|---|
| … | … | |
| 410 | 408 | ***************************************************************************** |
|---|
| 411 | 409 | * Read from several sockets. Takes data from the first socket that has some. |
|---|
| 412 | | * if timeout is zero, net_Select will wait indefinitely. timeout is in |
|---|
| 413 | | * millisecond. |
|---|
| 414 | 410 | *****************************************************************************/ |
|---|
| 415 | 411 | ssize_t __net_Select( vlc_object_t *restrict p_this, |
|---|
| 416 | 412 | const int *restrict fds, int nfd, |
|---|
| 417 | | uint8_t *restrict buf, size_t len, |
|---|
| 418 | | int timeout ) |
|---|
| | 413 | uint8_t *restrict buf, size_t len ) |
|---|
| 419 | 414 | { |
|---|
| 420 | 415 | const v_socket_t *vsv[nfd]; |
|---|
| … | … | |
| 422 | 417 | |
|---|
| 423 | 418 | return net_ReadInner( p_this, nfd, fds, vsv, |
|---|
| 424 | | buf, len, VLC_FALSE, timeout ); |
|---|
| | 419 | buf, len, VLC_FALSE ); |
|---|
| 425 | 420 | } |
|---|
| 426 | 421 | |
|---|