X-Git-Url: http://lists.indexdata.com/cgi-bin?a=blobdiff_plain;f=src%2Fconnection.c;h=98a73e00bd7316057981bb565879e6b88f44cd23;hb=4ae1e0582f66acaec33dca2c3b023d47d7f431af;hp=ec62cf5ff098c0f7145a3e27135defb1871f15cd;hpb=9a3c5c3ab67208a3bf00630976113cd7ebf68f38;p=pazpar2-moved-to-github.git diff --git a/src/connection.c b/src/connection.c index ec62cf5..98a73e0 100644 --- 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; + int ret; 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; - connection_connect(co, iochan_man); - + ret = connection_connect(co, iochan_man); connection_use(1); + if (ret) + { /* error */ + connection_destroy(co); + co = 0; + } return co; } @@ -241,10 +246,7 @@ static void non_block_events(struct connection *co) { struct client *cl = co->client; if (cl) - { - client_check_preferred_watch(cl); client_got_records(cl); - } } }