X-Git-Url: http://jsfdemo.indexdata.com/?a=blobdiff_plain;f=src%2Fconnection.c;h=9a29f9003fd4ea9e1a29a50cd0216ab2ff51cb2f;hb=7d4ba557fe01543f0a3aac7a1a738a426d0a1eff;hp=d3eaeefe4148fd1280aa907137938fcb6f428acd;hpb=5a6816065057859b44273d5c674371c56311a667;p=pazpar2-moved-to-github.git diff --git a/src/connection.c b/src/connection.c index d3eaeef..9a29f90 100644 --- a/src/connection.c +++ b/src/connection.c @@ -1,5 +1,5 @@ /* This file is part of Pazpar2. - Copyright (C) 2006-2012 Index Data + Copyright (C) 2006-2013 Index Data Pazpar2 is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free @@ -323,9 +323,8 @@ static void connection_handler(IOCHAN iochan, int event) else if (event & EVENT_TIMEOUT) { ZOOM_connection_fire_event_timeout(co->link); - client_lock(cl); + non_block_events(co); - client_unlock(cl); remove_connection_from_host(co); yaz_mutex_leave(host->mutex); @@ -335,13 +334,11 @@ static void connection_handler(IOCHAN iochan, int event) { yaz_mutex_leave(host->mutex); - client_lock(cl); non_block_events(co); ZOOM_connection_fire_event_socket(co->link, event); non_block_events(co); - client_unlock(cl); if (co->link) { @@ -463,13 +460,13 @@ static int connection_connect(struct connection *con, iochan_man_t iochan_man) return -1; } - if (sru && *sru) + if (sru && *sru && !strstr(host->url, "://")) { - char http_hostport[512]; - strcpy(http_hostport, "http://"); - strcat(http_hostport, host->url); - yaz_log(YLOG_LOG, "SRU connect to : %s", http_hostport); - ZOOM_connection_connect(con->link, http_hostport, 0); + WRBUF w = wrbuf_alloc(); + wrbuf_puts(w, "http://"); + wrbuf_puts(w, host->url); + ZOOM_connection_connect(con->link, wrbuf_cstr(w), 0); + wrbuf_destroy(w); } else {