From: Sebastian Hammer Date: Sun, 15 Apr 2007 00:35:57 +0000 (+0000) Subject: Modified http_create. Used a per-request nmem structure to allocate space for the X-Git-Tag: PAZPAR2.1.0.0~297 X-Git-Url: http://lists.indexdata.com/cgi-bin?a=commitdiff_plain;ds=sidebyside;h=1f6844b18354bd131532c1403179923848145c09;hp=606fdfa493ec8360a2a43b4bd396e8f891defc63;p=pazpar2-moved-to-github.git Modified http_create. Used a per-request nmem structure to allocate space for the address. Changed this to a constant-size buffer. --- diff --git a/src/http.c b/src/http.c index 096d4e6..e408fe8 100644 --- a/src/http.c +++ b/src/http.c @@ -1,4 +1,4 @@ -/* $Id: http.c,v 1.25 2007-04-11 11:10:05 marc Exp $ +/* $Id: http.c,v 1.26 2007-04-15 00:35:57 quinn Exp $ Copyright (c) 2006-2007, Index Data. This file is part of Pazpar2. @@ -946,7 +946,7 @@ static struct http_channel *http_create(const char *addr) yaz_log(YLOG_WARN, "Invalid HTTP forward address"); exit(1); } - r->addr = nmem_strdup(r->nmem, addr); + strcpy(r->addr, addr); return r; } diff --git a/src/http.h b/src/http.h index be86bb2..8a6ac1d 100644 --- a/src/http.h +++ b/src/http.h @@ -1,4 +1,4 @@ -/* $Id: http.h,v 1.7 2007-04-10 08:48:56 adam Exp $ +/* $Id: http.h,v 1.8 2007-04-15 00:35:57 quinn Exp $ Copyright (c) 2006-2007, Index Data. This file is part of Pazpar2. @@ -49,7 +49,7 @@ struct http_channel struct http_request *request; struct http_response *response; struct http_channel *next; // for freelist - char *addr; /* forwarded address */ + char addr[20]; // forwarded address }; struct http_proxy // attached to iochan for proxy connection