| 52 | } RTMP_HTTPContext; |
| 53 | |
| 54 | static int rtmp_http_send_cmd(URLContext *h, const char *cmd) |
| 55 | { |
| 56 | RTMP_HTTPContext *rt = h->priv_data; |
| 57 | char uri[2048]; |
| 58 | uint8_t c; |
| 59 | int ret; |
| 60 | |
| 61 | ff_url_join(uri, sizeof(uri), "http", NULL, rt->host, rt->port, |
| 62 | "/%s/%s/%d", cmd, rt->client_id, rt->seq++); |
| 63 | |
| 64 | av_opt_set_bin(rt->stream->priv_data, "post_data", rt->out_data, |
| 65 | rt->out_size, 0); |
| 66 | |
| 67 | /* send a new request to the server */ |
| 68 | if ((ret = ff_http_do_new_request(rt->stream, uri)) < 0) |
| 69 | return ret; |
| 70 | |
| 71 | /* re-init output buffer */ |
| 72 | rt->out_size = 0; |
| 73 | |
| 74 | /* read the first byte which contains the polling interval */ |
| 75 | if ((ret = ffurl_read(rt->stream, &c, 1)) < 0) |
| 76 | return ret; |
| 77 | |
| 78 | /* re-init the number of bytes read */ |
| 79 | rt->nb_bytes_read = 0; |
| 80 | |
| 81 | return ret; |
| 82 | } |
| 83 | |
| 84 | static int rtmp_http_write(URLContext *h, const uint8_t *buf, int size) |
| 85 | { |
no test coverage detected