13
13
* Portions Copyright (c) 1994, Regents of the University of California
14
14
*
15
15
* IDENTIFICATION
16
- * $Header: /cvsroot/pgsql/src/interfaces/libpgtcl/Attic/pgtclId.c,v 1.31 2002/08/17 12:19:31 momjian Exp $
16
+ * $Header: /cvsroot/pgsql/src/interfaces/libpgtcl/Attic/pgtclId.c,v 1.32 2002/08/18 01:39:43 momjian Exp $
17
17
*
18
18
*-------------------------------------------------------------------------
19
19
*/
@@ -277,7 +277,7 @@ PgDelConnectionId(DRIVER_DEL_PROTO)
277
277
* Turn off the Tcl event source for this connection, and delete any
278
278
* pending notify events.
279
279
*/
280
- PgStopNotifyEventSource (connid , 1 );
280
+ PgStopNotifyEventSource (connid );
281
281
282
282
/* Close the libpq connection too */
283
283
PQfinish (connid -> conn );
@@ -441,7 +441,7 @@ PgGetConnByResultId(Tcl_Interp *interp, char *resid_c)
441
441
* mark = '.' ;
442
442
if (conn_chan && Tcl_GetChannelType (conn_chan ) == & Pg_ConnType )
443
443
{
444
- Tcl_SetResult (interp , ( char * ) Tcl_GetChannelName (conn_chan ), TCL_VOLATILE );
444
+ Tcl_SetResult (interp , Tcl_GetChannelName (conn_chan ), TCL_VOLATILE );
445
445
return TCL_OK ;
446
446
}
447
447
@@ -611,9 +611,7 @@ PgNotifyTransferEvents(Pg_ConnectionId * connid)
611
611
* closed socket descriptor.
612
612
*/
613
613
if (PQsocket (connid -> conn ) < 0 )
614
- /* do not remove any pending events, so that the virtual notification
615
- connection_closed will be processed */
616
- PgStopNotifyEventSource (connid ,0 );
614
+ PgStopNotifyEventSource (connid );
617
615
}
618
616
619
617
/*
@@ -677,17 +675,7 @@ Pg_Notify_FileHandler(ClientData clientData, int mask)
677
675
* it internally to libpq; but it will clear the read-ready
678
676
* condition).
679
677
*/
680
- if (!PQconsumeInput (connid -> conn )) {
681
- NotifyEvent * event = (NotifyEvent * ) ckalloc (sizeof (NotifyEvent ));
682
-
683
- PGnotify * closed = (PGnotify * ) ckalloc (sizeof (PGnotify ));
684
- strcpy (closed -> relname ,"connection_closed" );
685
- event -> header .proc = Pg_Notify_EventProc ;
686
- event -> info = * closed ;
687
- event -> connid = connid ;
688
- Tcl_QueueEvent ((Tcl_Event * ) event , TCL_QUEUE_TAIL );
689
- ckfree ((void * )closed );
690
- }
678
+ PQconsumeInput (connid -> conn );
691
679
692
680
/* Transfer notify events from libpq to Tcl event queue. */
693
681
PgNotifyTransferEvents (connid );
@@ -736,7 +724,7 @@ PgStartNotifyEventSource(Pg_ConnectionId * connid)
736
724
}
737
725
738
726
void
739
- PgStopNotifyEventSource (Pg_ConnectionId * connid , int remove_pending )
727
+ PgStopNotifyEventSource (Pg_ConnectionId * connid )
740
728
{
741
729
/* Remove the event source */
742
730
if (connid -> notifier_running )
@@ -755,5 +743,5 @@ PgStopNotifyEventSource(Pg_ConnectionId * connid, int remove_pending)
755
743
}
756
744
757
745
/* Kill any queued Tcl events that reference this channel */
758
- if ( remove_pending ) Tcl_DeleteEvents (NotifyEventDeleteProc , (ClientData ) connid );
746
+ Tcl_DeleteEvents (NotifyEventDeleteProc , (ClientData ) connid );
759
747
}
0 commit comments