diff options
-rw-r--r-- | ext/yaz/php_yaz.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/ext/yaz/php_yaz.c b/ext/yaz/php_yaz.c index f4fb772e15..218e2613e0 100644 --- a/ext/yaz/php_yaz.c +++ b/ext/yaz/php_yaz.c @@ -996,14 +996,14 @@ static int do_event (int *id, int timeout) } else if (p->state == PHP_YAZ_STATE_CONNECTING) { - if (FD_ISSET (fd, &input)) + if (FD_ISSET (fd, &output)) { - do_close(p); - p->error = PHP_YAZ_ERROR_CONNECT; + send_init(p); } - else if (FD_ISSET (fd, &output)) + else if (FD_ISSET (fd, &input)) { - send_init(p); + do_close(p); + p->error = PHP_YAZ_ERROR_CONNECT; } } else if (p->state == PHP_YAZ_STATE_ESTABLISHED) |