fixed caching in record_local_path on HTTP error code

This commit is contained in:
Roman Arutyunyan 2013-03-03 18:00:06 +04:00
parent ee4f57bc69
commit 8526a59fd4
2 changed files with 9 additions and 0 deletions

View file

@ -929,6 +929,13 @@ ngx_rtmp_play_remote_sink(ngx_rtmp_session_t *s, ngx_chain_t *in)
default:
ctx->ncrs = 0;
}
/* 10th header byte is HTTP response header */
if (++ctx->nheader == 10 && *b->pos != (u_char) '2') {
ngx_log_error(NGX_LOG_INFO, s->connection->log, 0,
"play: remote HTTP response code: %cxx",
*b->pos);
return NGX_ERROR;
}
}
if (b->pos == b->last) {
@ -992,6 +999,7 @@ ngx_rtmp_play_open_remote(ngx_rtmp_session_t *s, ngx_rtmp_play_t *v)
ctx = ngx_rtmp_get_module_ctx(s, ngx_rtmp_play_module);
ctx->ncrs = 0;
ctx->nheader = 0;
ctx->nbody = 0;
for ( ;; ) {

View file

@ -44,6 +44,7 @@ typedef struct {
ngx_event_t send_evt;
unsigned playing:1;
ngx_uint_t ncrs;
ngx_uint_t nheader;
ngx_uint_t nbody;
size_t pfx_size;
ngx_str_t sfx;