From 0eb32ae1ca0b80d236df5c2b81ce37885f155187 Mon Sep 17 00:00:00 2001 From: Roman Arutyunyan Date: Thu, 28 Nov 2013 21:31:30 +0400 Subject: [PATCH] fixing hls & dash cleanup --- dash/ngx_rtmp_dash_module.c | 6 +++--- hls/ngx_rtmp_hls_module.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dash/ngx_rtmp_dash_module.c b/dash/ngx_rtmp_dash_module.c index 472039d..0ad7552 100644 --- a/dash/ngx_rtmp_dash_module.c +++ b/dash/ngx_rtmp_dash_module.c @@ -1294,10 +1294,10 @@ ngx_rtmp_dash_cleanup_dir(ngx_str_t *ppath, ngx_msec_t playlen) ngx_log_debug1(NGX_LOG_DEBUG_RTMP, ngx_cycle->log, 0, "dash: cleanup dir '%V'", &name); - if (ngx_delete_dir(spath.data) == NGX_FILE_ERROR) { + if (ngx_delete_dir(path) == NGX_FILE_ERROR) { ngx_log_error(NGX_LOG_ERR, ngx_cycle->log, ngx_errno, "dash: cleanup " ngx_delete_dir_n - "failed on '%V'", &spath); + " failed on '%V'", &spath); } else { nerased++; } @@ -1385,7 +1385,7 @@ ngx_rtmp_dash_cleanup_dir(ngx_str_t *ppath, ngx_msec_t playlen) "dash: cleanup '%V' mtime=%T age=%T", &name, mtime, ngx_cached_time->sec - mtime); - if (ngx_delete_file(spath.data) == NGX_FILE_ERROR) { + if (ngx_delete_file(path) == NGX_FILE_ERROR) { ngx_log_error(NGX_LOG_ERR, ngx_cycle->log, ngx_errno, "dash: cleanup " ngx_delete_file_n " failed on '%V'", &spath); diff --git a/hls/ngx_rtmp_hls_module.c b/hls/ngx_rtmp_hls_module.c index f1dacce..d9b75a0 100644 --- a/hls/ngx_rtmp_hls_module.c +++ b/hls/ngx_rtmp_hls_module.c @@ -1974,10 +1974,10 @@ ngx_rtmp_hls_cleanup_dir(ngx_str_t *ppath, ngx_msec_t playlen) ngx_log_debug1(NGX_LOG_DEBUG_RTMP, ngx_cycle->log, 0, "hls: cleanup dir '%V'", &name); - if (ngx_delete_dir(spath.data) != NGX_OK) { + if (ngx_delete_dir(path) == NGX_FILE_ERROR) { ngx_log_error(NGX_LOG_ERR, ngx_cycle->log, ngx_errno, "hls: cleanup " ngx_delete_dir_n - "failed on '%V'", &spath); + " failed on '%V' ('%s')", &spath, path); } else { nerased++; } @@ -2019,7 +2019,7 @@ ngx_rtmp_hls_cleanup_dir(ngx_str_t *ppath, ngx_msec_t playlen) "hls: cleanup '%V' mtime=%T age=%T", &name, mtime, ngx_cached_time->sec - mtime); - if (ngx_delete_file(spath.data) == NGX_FILE_ERROR) { + if (ngx_delete_file(path) == NGX_FILE_ERROR) { ngx_log_error(NGX_LOG_ERR, ngx_cycle->log, ngx_errno, "hls: cleanup " ngx_delete_file_n " failed on '%V'", &spath);