| 267 | } |
| 268 | |
| 269 | static int tcp_read(URLContext *h, uint8_t *buf, int size) |
| 270 | { |
| 271 | TCPContext *s = h->priv_data; |
| 272 | int ret; |
| 273 | |
| 274 | if (!(h->flags & AVIO_FLAG_NONBLOCK)) { |
| 275 | ret = ff_network_wait_fd_timeout(s->fd, 0, h->rw_timeout, &h->interrupt_callback); |
| 276 | if (ret) |
| 277 | return ret; |
| 278 | } |
| 279 | ret = recv(s->fd, buf, size, 0); |
| 280 | if (ret == 0) |
| 281 | return AVERROR_EOF; |
| 282 | return ret < 0 ? ff_neterrno() : ret; |
| 283 | } |
| 284 | |
| 285 | static int tcp_write(URLContext *h, const uint8_t *buf, int size) |
| 286 | { |
nothing calls this directly
no test coverage detected