From 2e73c1b2712dfff4b64e6b8805ef863e45350eb3 Mon Sep 17 00:00:00 2001 From: "Stephen R. van den Berg" <srb@cuci.nl> Date: Tue, 25 Feb 2020 01:45:16 +0100 Subject: [PATCH] pgsql: Simplify code. --- lib/modules/Sql.pmod/pgsql_util.pmod | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/modules/Sql.pmod/pgsql_util.pmod b/lib/modules/Sql.pmod/pgsql_util.pmod index 1066a80de1..9796877dc3 100644 --- a/lib/modules/Sql.pmod/pgsql_util.pmod +++ b/lib/modules/Sql.pmod/pgsql_util.pmod @@ -425,7 +425,6 @@ class conxion { |SSL.File #endif socket; - private int towrite; final multiset(sql_result) runningportals = (<>); final MUTEX nostash; @@ -496,7 +495,7 @@ class conxion { private int write_cb() { Thread.MutexKey lock = shortmux->lock(); if (this) { // Guard against async destructs - towrite -= output_to(socket, towrite); + output_to(socket); lock = 0; if (!i->fillread && !sizeof(this)) close(); @@ -564,10 +563,10 @@ outer: case SENDOUT:; } Thread.MutexKey lock = shortmux->trylock(); - if (lock && (towrite = sizeof(this))) { + if (lock && sizeof(this)) { PD("%d>Sendcmd %O\n", - socket->query_fd(), ((string)this)[..towrite-1]); - towrite -= output_to(socket, towrite); + socket->query_fd(), (string)this); + output_to(socket); } } while (0); started = 0; -- GitLab