diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2004-10-16 22:52:55 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2004-10-16 22:52:55 +0000 |
commit | cc6a90e4afbc0e7d2c5959203814a95fa9eb1123 (patch) | |
tree | 48a237c916075018093e9ecb7bb7cd09f81f77d7 /src/interfaces/libpq/fe-exec.c | |
parent | b3d58ea7ec6df499a46baa4327ea400746199fc5 (diff) | |
download | postgresql-cc6a90e4afbc0e7d2c5959203814a95fa9eb1123.tar.gz postgresql-cc6a90e4afbc0e7d2c5959203814a95fa9eb1123.zip |
Remove dllist.c from libpq. It's overkill for what libpq needs; we can
just stick a list-link into struct PGnotify instead. Result is a smaller
faster and more robust library (mainly because we reduce the number of
malloc's and free's involved in notify processing), plus less pollution
of application link-symbol namespace.
Diffstat (limited to 'src/interfaces/libpq/fe-exec.c')
-rw-r--r-- | src/interfaces/libpq/fe-exec.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/interfaces/libpq/fe-exec.c b/src/interfaces/libpq/fe-exec.c index 5ac115fe792..5e19d78b37a 100644 --- a/src/interfaces/libpq/fe-exec.c +++ b/src/interfaces/libpq/fe-exec.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/interfaces/libpq/fe-exec.c,v 1.162 2004/08/30 02:54:41 momjian Exp $ + * $PostgreSQL: pgsql/src/interfaces/libpq/fe-exec.c,v 1.163 2004/10/16 22:52:53 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -1323,7 +1323,6 @@ PQexecFinish(PGconn *conn) PGnotify * PQnotifies(PGconn *conn) { - Dlelem *e; PGnotify *event; if (!conn) @@ -1332,12 +1331,14 @@ PQnotifies(PGconn *conn) /* Parse any available data to see if we can extract NOTIFY messages. */ parseInput(conn); - /* RemHead returns NULL if list is empty */ - e = DLRemHead(conn->notifyList); - if (!e) - return NULL; - event = (PGnotify *) DLE_VAL(e); - DLFreeElem(e); + event = conn->notifyHead; + if (event) + { + conn->notifyHead = event->next; + if (!conn->notifyHead) + conn->notifyTail = NULL; + event->next = NULL; /* don't let app see the internal state */ + } return event; } |