! * Users doing non-blocking connections need to handle the reset
authorBruce Momjian <[email protected]>
Thu, 25 May 2000 19:09:55 +0000 (19:09 +0000)
committerBruce Momjian <[email protected]>
Thu, 25 May 2000 19:09:55 +0000 (19:09 +0000)
!        * themselves, they'll need to check the connection status if we
!        * return an error.

Alfred Perlstein

src/interfaces/libpq/fe-exec.c

index 6617bb2bc30deaea61af4b4f44e3b37ca8f1800a..b90159af4dd1125010a8cc9bf5013d713a975d2b 100644 (file)
@@ -8,7 +8,7 @@
  *
  *
  * IDENTIFICATION
- *   $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-exec.c,v 1.94 2000/04/12 17:17:14 momjian Exp $
+ *   $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-exec.c,v 1.95 2000/05/25 19:09:55 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -1587,7 +1587,15 @@ PQendcopy(PGconn *conn)
 
    DONOTICE(conn, "PQendcopy: resetting connection\n");
 
-   PQreset(conn);
+   /*
+    * Users doing non-blocking connections need to handle the reset
+    * themselves, they'll need to check the connection status if we
+    * return an error.
+    */
+   if (pqIsnonblocking(conn))
+       PQresetStart(conn);
+   else
+       PQreset(conn);
 
    return 1;
 }