X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=zoom%2Fzoom-c.c;h=2136dab6dc1bbf9d6fcff72bdf65ef06d7ef6f68;hb=6361856cbc8d8ddd689ce877dfb04c939504da03;hp=481f90405192d2602a5c3c96a39a100c8914f81b;hpb=08e514143cd7d16db15c1c3d4d15d687f561c047;p=yaz-moved-to-github.git diff --git a/zoom/zoom-c.c b/zoom/zoom-c.c index 481f904..2136dab 100644 --- a/zoom/zoom-c.c +++ b/zoom/zoom-c.c @@ -1,5 +1,5 @@ /* - * $Id: zoom-c.c,v 1.24 2002-02-28 13:21:16 adam Exp $ + * $Id: zoom-c.c,v 1.26 2002-05-07 11:00:58 adam Exp $ * * ZOOM layer for C, connections, result sets, queries. */ @@ -16,6 +16,8 @@ #include #endif +static int ZOOM_connection_send_init (ZOOM_connection c); + static ZOOM_Event ZOOM_Event_create (int kind) { ZOOM_Event event = (ZOOM_Event) xmalloc (sizeof(*event)); @@ -331,6 +333,9 @@ void ZOOM_connection_destroy(ZOOM_connection c) ZOOM_options_destroy (c->options); ZOOM_connection_remove_tasks (c); xfree (c->host_port); + xfree (c->proxy); + xfree (c->cookie_out); + xfree (c->cookie_in); xfree (c); } @@ -519,7 +524,15 @@ static int do_connect (ZOOM_connection c) { int ret = cs_connect (c->cs, add); yaz_log (LOG_DEBUG, "cs_connect returned %d", ret); - if (ret >= 0) + if (ret == 0) + { + ZOOM_Event event = ZOOM_Event_create(ZOOM_EVENT_CONNECT); + ZOOM_connection_put_event(c, event); + ZOOM_connection_send_init(c); + c->state = STATE_ESTABLISHED; + return 1; + } + else if (ret > 0) { c->state = STATE_CONNECTING; c->mask = ZOOM_SELECT_EXCEPT;