| 275 | } |
| 276 | |
| 277 | static int rtmpe_read(URLContext *h, uint8_t *buf, int size) |
| 278 | { |
| 279 | RTMPEContext *rt = h->priv_data; |
| 280 | int ret; |
| 281 | |
| 282 | rt->stream->flags |= h->flags & AVIO_FLAG_NONBLOCK; |
| 283 | ret = ffurl_read(rt->stream, buf, size); |
| 284 | rt->stream->flags &= ~AVIO_FLAG_NONBLOCK; |
| 285 | |
| 286 | if (ret < 0 && ret != AVERROR_EOF) |
| 287 | return ret; |
| 288 | |
| 289 | if (rt->handshaked && ret > 0) { |
| 290 | /* decrypt data received by the server */ |
| 291 | av_rc4_crypt(&rt->key_in, buf, buf, ret, NULL, 1); |
| 292 | } |
| 293 | |
| 294 | return ret; |
| 295 | } |
| 296 | |
| 297 | static int rtmpe_write(URLContext *h, const uint8_t *buf, int size) |
| 298 | { |
nothing calls this directly
no test coverage detected