From f7fab67ffbf2385d864768161af247cf839e09b8 Mon Sep 17 00:00:00 2001 From: Roman Arutyunyan Date: Thu, 8 Nov 2012 10:53:21 +0400 Subject: [PATCH] fixed netcall http client --- ngx_rtmp_netcall_module.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ngx_rtmp_netcall_module.c b/ngx_rtmp_netcall_module.c index 380f250..f4414d9 100644 --- a/ngx_rtmp_netcall_module.c +++ b/ngx_rtmp_netcall_module.c @@ -500,7 +500,7 @@ ngx_rtmp_netcall_http_format_request(ngx_int_t method, ngx_str_t *host, ngx_buf_t *b; size_t content_length; static const char *methods[2] = { "GET", "POST" }; - static const char rq_tmpl[] = "HTTP/1.0\r\n" + static const char rq_tmpl[] = " HTTP/1.0\r\n" "Host: %V\r\n" "Content-Type: %V\r\n" "Connection: Close\r\n" @@ -521,13 +521,13 @@ ngx_rtmp_netcall_http_format_request(ngx_int_t method, ngx_str_t *host, } b = ngx_create_temp_buf(pool, sizeof("POST") + /* longest method + 1 */ - uri->len + 1); + uri->len); if (b == NULL) { return NULL; } b->last = ngx_snprintf(b->last, b->end - b->last, "%s %V", - methods[method], &uri); + methods[method], uri); al->buf = b; @@ -555,7 +555,7 @@ ngx_rtmp_netcall_http_format_request(ngx_int_t method, ngx_str_t *host, bl->buf = b; b->last = ngx_snprintf(b->last, b->end - b->last, rq_tmpl, - &host, content_type, content_length); + host, content_type, content_length); al->next = bl; bl->next = body;