From: Oliver Jowett <oliver@opencloud.com>
To: Kris Jurka <books@ejurka.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: setBinaryStream can abandon connection
Date: Mon, 18 Oct 2004 10:27:08 +1300
Message-ID: <4172E3AC.1040102@opencloud.com> (raw)
In-Reply-To: <Pine.BSO.4.56.0410171602050.16087@leary.csoft.net>
References: <Pine.BSO.4.56.0410170735120.16087@leary.csoft.net>
<4172CCFC.3030503@opencloud.com>
<Pine.BSO.4.56.0410171602050.16087@leary.csoft.net>
Kris Jurka wrote:
> The message length will not cause the backend to allocate large amounts of
> memory, the individual parameter lengths are what actually allocates
> memory.
Are you sure about this? I see in pq_getmessage (called from the main
backend loop via SocketBackend):
if (len > 0)
{
/* Allocate space for message */
enlargeStringInfo(s, len);
/* And grab the message */
if (pq_getbytes(s->data, len) == EOF)
// ...
}
'len' is the total packet length, not a per-parameter length.
> So if we don't have a problem with a broken connection we don't actually
> need to check for these errors because they don't do anything terrible,
> but obviously I believe a broken connection is bad.
I'd still like to see a more useful error message in the overflow case.
We really shouldn't be generating a negative message length in the first
place.
-O
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: oliver@opencloud.com, books@ejurka.com
Subject: Re: setBinaryStream can abandon connection
In-Reply-To: <4172E3AC.1040102@opencloud.com>
References: <Pine.BSO.4.56.0410170735120.16087@leary.csoft.net> <4172CCFC.3030503@opencloud.com> <Pine.BSO.4.56.0410171602050.16087@leary.csoft.net> <4172E3AC.1040102@opencloud.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox