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
test_icu has rule to remove leading whitespace
[pazpar2-moved-to-github.git]
/
src
/
connection.c
diff --git
a/src/connection.c
b/src/connection.c
index
7483118
..
98a73e0
100644
(file)
--- a/
src/connection.c
+++ b/
src/connection.c
@@
-144,6
+144,7
@@
static struct connection *connection_create(struct client *cl,
iochan_man_t iochan_man)
{
struct connection *co;
iochan_man_t iochan_man)
{
struct connection *co;
+ int ret;
co = xmalloc(sizeof(*co));
co = xmalloc(sizeof(*co));
@@
-159,9
+160,13
@@
static struct connection *connection_create(struct client *cl,
co->operation_timeout = operation_timeout;
co->session_timeout = session_timeout;
co->operation_timeout = operation_timeout;
co->session_timeout = session_timeout;
- connection_connect(co, iochan_man);
-
+ ret = connection_connect(co, iochan_man);
connection_use(1);
connection_use(1);
+ if (ret)
+ { /* error */
+ connection_destroy(co);
+ co = 0;
+ }
return co;
}
return co;
}
@@
-241,10
+246,7
@@
static void non_block_events(struct connection *co)
{
struct client *cl = co->client;
if (cl)
{
struct client *cl = co->client;
if (cl)
- {
- client_check_preferred_watch(cl);
client_got_records(cl);
client_got_records(cl);
- }
}
}
}
}
@@
-450,6
+452,8
@@
int client_prep_connection(struct client *cl,
client_get_id(cl), url);
co = client_get_connection(cl);
client_get_id(cl), url);
co = client_get_connection(cl);
+ if (co)
+ return 2;
if (!co)
{
co = connection_create(cl, url, zproxy,
if (!co)
{
co = connection_create(cl, url, zproxy,