|
3 | 3 | * Copyright (C) Winshining |
4 | 4 | */ |
5 | 5 |
|
| 6 | +#include <ngx_config.h> |
| 7 | +#include <ngx_core.h> |
| 8 | +#include <ngx_http.h> |
6 | 9 | #include "ngx_http_flv_live_module.h" |
7 | 10 | #include "ngx_rtmp_relay_module.h" |
8 | 11 |
|
@@ -358,7 +361,7 @@ ngx_http_flv_live_send_tail(ngx_rtmp_session_t *s) |
358 | 361 | buf_resp_hdr.pos = response_tail.data; |
359 | 362 | buf_resp_hdr.last = response_tail.data + response_tail.len; |
360 | 363 | buf_resp_hdr.start = buf_resp_hdr.pos; |
361 | | - buf_resp_hdr.end = buf_resp_hdr.end; |
| 364 | + buf_resp_hdr.end = buf_resp_hdr.last; |
362 | 365 |
|
363 | 366 | cl_resp_hdr.buf = &buf_resp_hdr; |
364 | 367 | cl_resp_hdr.next = NULL; |
@@ -1303,8 +1306,14 @@ ngx_http_flv_live_append_shared_bufs(ngx_rtmp_core_srv_conf_t *cscf, |
1303 | 1306 | { |
1304 | 1307 | ngx_chain_t *tag, *chunk_head, *chunk_tail, chunk, |
1305 | 1308 | *iter, *last_in, **tail, prev_tag_size; |
1306 | | - u_char *pos, *p, chunk_item[ngx_strlen("1000003"CRLF) + 1]; |
1307 | | - uint32_t data_size, tag_size, size; |
| 1309 | + u_char *pos, *p, |
| 1310 | +#if !(NGX_WIN32) |
| 1311 | + chunk_item[ngx_strlen("0000000000000000" CRLF) + 1]; |
| 1312 | +#else |
| 1313 | + chunk_item[19]; |
| 1314 | +#endif |
| 1315 | + uint32_t data_size, size; |
| 1316 | + off_t tag_size; |
1308 | 1317 | ngx_buf_t prev_tag_size_buf, chunk_buf; |
1309 | 1318 |
|
1310 | 1319 | for (data_size = 0, iter = in, last_in = iter; iter; iter = iter->next) { |
@@ -1372,7 +1381,7 @@ ngx_http_flv_live_append_shared_bufs(ngx_rtmp_core_srv_conf_t *cscf, |
1372 | 1381 | /* add chunk header and tail */ |
1373 | 1382 | if (chunked) { |
1374 | 1383 | /* 4 is the size of previous tag size itself */ |
1375 | | - *ngx_sprintf(chunk_item, "%xO"CRLF, tag_size + 4) = 0; |
| 1384 | + *ngx_sprintf(chunk_item, "%xO" CRLF, tag_size + 4) = 0; |
1376 | 1385 |
|
1377 | 1386 | chunk_buf.start = chunk_item; |
1378 | 1387 | chunk_buf.pos = chunk_buf.start; |
|
0 commit comments