Base changes to HTTP.c on correct file version

This commit is contained in:
Simon Robertshaw 2012-05-09 21:12:10 +01:00
parent aeb383742f
commit 0c8fae82c7

View File

@ -6,7 +6,7 @@
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
@ -15,8 +15,7 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program. If not, see <http://www.gnu.org/licenses/>.
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
*/ */
@ -468,7 +467,7 @@ int http_async_req_status(void *ctx)
if (cx->txdl) if (cx->txdl)
{ {
// generate POST // generate POST
cx->tbuf = malloc(strlen(cx->host) + strlen(cx->path) + 127 + cx->txdl + cx->thlen); cx->tbuf = malloc(strlen(cx->host) + strlen(cx->path) + 126 + cx->txdl + cx->thlen);
cx->tptr = 0; cx->tptr = 0;
cx->tlen = 0; cx->tlen = 0;
cx->tlen += sprintf(cx->tbuf+cx->tlen, "POST %s HTTP/1.1\r\n", cx->path); cx->tlen += sprintf(cx->tbuf+cx->tlen, "POST %s HTTP/1.1\r\n", cx->path);
@ -499,7 +498,7 @@ int http_async_req_status(void *ctx)
else else
{ {
// generate GET // generate GET
cx->tbuf = malloc(strlen(cx->host) + strlen(cx->path) + 95 + cx->thlen); cx->tbuf = malloc(strlen(cx->host) + strlen(cx->path) +93 + cx->thlen);
cx->tptr = 0; cx->tptr = 0;
cx->tlen = 0; cx->tlen = 0;
cx->tlen += sprintf(cx->tbuf+cx->tlen, "GET %s HTTP/1.1\r\n", cx->path); cx->tlen += sprintf(cx->tbuf+cx->tlen, "GET %s HTTP/1.1\r\n", cx->path);