X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id A45FA32A54E for ; Mon, 18 Oct 2004 03:02:40 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 95275-08 for ; Mon, 18 Oct 2004 02:02:28 +0000 (GMT) Received: from yass.opencloud.co.nz (yass.opencloud.co.nz [203.79.85.162]) by svr1.postgresql.org (Postfix) with ESMTP id 1A25632B069 for ; Mon, 18 Oct 2004 03:02:15 +0100 (BST) Received: from 203-79-104-60.cable.paradise.net.nz ([203.79.104.60] helo=opencloud.com) by yass.opencloud.co.nz with asmtp (Exim 3.35 #1 (Debian)) id 1CJMqi-0003zH-00; Mon, 18 Oct 2004 15:02:13 +1300 Message-ID: <41732423.1080407@opencloud.com> Date: Mon, 18 Oct 2004 15:02:11 +1300 From: Oliver Jowett User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6b) Gecko/20031205 Thunderbird/0.4 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Kris Jurka Cc: pgsql-jdbc@postgresql.org Subject: Re: setBinaryStream can abandon connection References: <4172CCFC.3030503@opencloud.com> <4172E3AC.1040102@opencloud.com> In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200410/185 X-Sequence-Number: 11290 Kris Jurka wrote: > OK. So we should calculate the total message length using a "long" > variable to guard against overflow and then check that it doesn't exceed > MaxAllocSize. If it does, do not issue the bind at all and throw an > Exception in a fashion that keeps the connection in working order. Sounds reasonable. I was wondering if it was worth teaching PGstream (or a subclass) about the protocol format. Then it could automatically check for oversize messages, that we wrote as much data we claimed, and that when reading a server message we consumed the entire message. I don't know what the overhead of doing this would be, though. -O