projects
/
pazpar2-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Enable Solr tests again PAZ-894
[pazpar2-moved-to-github.git]
/
src
/
getaddrinfo.c
diff --git
a/src/getaddrinfo.c
b/src/getaddrinfo.c
index
24ce534
..
5796e32
100644
(file)
--- a/
src/getaddrinfo.c
+++ b/
src/getaddrinfo.c
@@
-40,9
+40,6
@@
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#if HAVE_NETDB_H
#include <netdb.h>
#endif
#if HAVE_NETDB_H
#include <netdb.h>
#endif
-#if HAVE_NETINET_IN_H
-#include <netinet/in.h>
-#endif
#include <yaz/log.h>
#include <yaz/nmem.h>
#include <yaz/log.h>
#include <yaz/nmem.h>
@@
-68,11
+65,11
@@
struct work {
static int log_level = YLOG_LOG;
static int log_level = YLOG_LOG;
-void perform_getaddrinfo(struct work *w)
+static void perform_getaddrinfo(struct work *w)
{
struct addrinfo hints, *res;
char host[512], *cp;
{
struct addrinfo hints, *res;
char host[512], *cp;
- const char *port = 0;
+ char *port = 0;
int error;
hints.ai_flags = 0;
int error;
hints.ai_flags = 0;
@@
-99,13
+96,14
@@
void perform_getaddrinfo(struct work *w)
}
else
{
}
else
{
+ char n_host[512];
if (getnameinfo((struct sockaddr *) res->ai_addr, res->ai_addrlen,
if (getnameinfo((struct sockaddr *) res->ai_addr, res->ai_addrlen,
- host, sizeof(host)-1,
+ n_host, sizeof(n_host)-1,
0, 0,
NI_NUMERICHOST) == 0)
{
0, 0,
NI_NUMERICHOST) == 0)
{
- w->ipport = xmalloc(strlen(host) + (port ? strlen(port) : 0) + 2);
- strcpy(w->ipport, host);
+ w->ipport = xmalloc(strlen(n_host) + (port ? strlen(port) : 0) + 2);
+ strcpy(w->ipport, n_host);
if (port)
{
strcat(w->ipport, ":");
if (port)
{
strcat(w->ipport, ":");
@@
-179,7
+177,7
@@
static void getaddrinfo_start(iochan_man_t iochan_man)
int host_getaddrinfo(struct host *host, iochan_man_t iochan_man)
{
struct work *w = xmalloc(sizeof(*w));
int host_getaddrinfo(struct host *host, iochan_man_t iochan_man)
{
struct work *w = xmalloc(sizeof(*w));
- int use_thread = 0; /* =0 to disable threading entirely */
+ int use_thread = 1; /* =0 to disable threading entirely */
w->hostport = host->tproxy ? host->tproxy : host->proxy;
w->ipport = 0;
w->hostport = host->tproxy ? host->tproxy : host->proxy;
w->ipport = 0;