]> granicus.if.org Git - php/commitdiff
Fixed bug where yaz_connect could fail in cases where it shouldn't.
authorAdam Dickmeiss <dickmeiss@php.net>
Wed, 30 May 2001 11:58:25 +0000 (11:58 +0000)
committerAdam Dickmeiss <dickmeiss@php.net>
Wed, 30 May 2001 11:58:25 +0000 (11:58 +0000)
ext/yaz/php_yaz.c

index f4fb772e15bad471f38110de7a73858316b5ac18..218e2613e0f7b45fb9baf5f6c3ab3a768333254d 100644 (file)
@@ -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)