From: | Oliver Jowett <oliver(at)opencloud(dot)com> |
---|---|
To: | Kris Jurka <books(at)ejurka(dot)com> |
Cc: | pgsql-jdbc(at)postgresql(dot)org |
Subject: | Re: setBinaryStream can abandon connection |
Date: | 2004-10-17 21:27:08 |
Message-ID: | 4172E3AC.1040102@opencloud.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-jdbc |
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
From | Date | Subject | |
---|---|---|---|
Next Message | Kris Jurka | 2004-10-17 21:50:22 | Re: setBinaryStream can abandon connection |
Previous Message | Kris Jurka | 2004-10-17 21:15:49 | Re: setBinaryStream can abandon connection |