Browse Source

Fix off by 1 in Content-Length

etomic
jl777 7 years ago
parent
commit
b87e0de75a
  1. 2
      iguana/exchanges/stats.c

2
iguana/exchanges/stats.c

@ -714,7 +714,7 @@ void LP_rpc_processreq(void *_ptr)
response = malloc(strlen(retstr)+1024+1+1); response = malloc(strlen(retstr)+1024+1+1);
//printf("alloc response.%p\n",response); //printf("alloc response.%p\n",response);
} }
sprintf(hdrs,"HTTP/1.1 200 OK\r\nAccess-Control-Allow-Origin: *\r\nAccess-Control-Allow-Credentials: true\r\nAccess-Control-Allow-Methods: GET, POST\r\nCache-Control : no-cache, no-store, must-revalidate\r\n%sContent-Length : %8d\r\n\r\n",content_type,(int32_t)strlen(retstr)); sprintf(hdrs,"HTTP/1.1 200 OK\r\nAccess-Control-Allow-Origin: *\r\nAccess-Control-Allow-Credentials: true\r\nAccess-Control-Allow-Methods: GET, POST\r\nCache-Control : no-cache, no-store, must-revalidate\r\n%sContent-Length : %8d\r\n\r\n",content_type,(int32_t)strlen(retstr)+1);
response[0] = '\0'; response[0] = '\0';
strcat(response,hdrs); strcat(response,hdrs);
strcat(response,retstr); strcat(response,retstr);

Loading…
Cancel
Save