1313 * Portions Copyright (c) 1994, Regents of the University of California
1414 *
1515 * 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 $
1717 *
1818 *-------------------------------------------------------------------------
1919 */
@@ -277,7 +277,7 @@ PgDelConnectionId(DRIVER_DEL_PROTO)
277277 * Turn off the Tcl event source for this connection, and delete any
278278 * pending notify events.
279279 */
280- PgStopNotifyEventSource (connid , 1 );
280+ PgStopNotifyEventSource (connid );
281281
282282/* Close the libpq connection too */
283283PQfinish (connid -> conn );
@@ -441,7 +441,7 @@ PgGetConnByResultId(Tcl_Interp *interp, char *resid_c)
441441* mark = '.' ;
442442if (conn_chan && Tcl_GetChannelType (conn_chan )== & Pg_ConnType )
443443{
444- Tcl_SetResult (interp ,( char * ) Tcl_GetChannelName (conn_chan ),TCL_VOLATILE );
444+ Tcl_SetResult (interp ,Tcl_GetChannelName (conn_chan ),TCL_VOLATILE );
445445return TCL_OK ;
446446}
447447
@@ -611,9 +611,7 @@ PgNotifyTransferEvents(Pg_ConnectionId * connid)
611611 * closed socket descriptor.
612612 */
613613if (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 );
617615}
618616
619617/*
@@ -677,17 +675,7 @@ Pg_Notify_FileHandler(ClientData clientData, int mask)
677675 * it internally to libpq; but it will clear the read-ready
678676 * condition).
679677 */
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 );
691679
692680/* Transfer notify events from libpq to Tcl event queue. */
693681PgNotifyTransferEvents (connid );
@@ -736,7 +724,7 @@ PgStartNotifyEventSource(Pg_ConnectionId * connid)
736724}
737725
738726void
739- PgStopNotifyEventSource (Pg_ConnectionId * connid , int remove_pending )
727+ PgStopNotifyEventSource (Pg_ConnectionId * connid )
740728{
741729/* Remove the event source */
742730if (connid -> notifier_running )
@@ -755,5 +743,5 @@ PgStopNotifyEventSource(Pg_ConnectionId * connid, int remove_pending)
755743}
756744
757745/* Kill any queued Tcl events that reference this channel */
758- if ( remove_pending ) Tcl_DeleteEvents (NotifyEventDeleteProc , (ClientData )connid );
746+ Tcl_DeleteEvents (NotifyEventDeleteProc , (ClientData )connid );
759747}