Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@apache.org Received: (qmail 72566 invoked from network); 30 Jan 2002 19:43:14 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 30 Jan 2002 19:43:14 -0000 Received: (qmail 19442 invoked by uid 97); 30 Jan 2002 19:43:16 -0000 Delivered-To: qmlist-jakarta-archive-commons-dev@jakarta.apache.org Received: (qmail 19425 invoked by uid 97); 30 Jan 2002 19:43:15 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 19414 invoked from network); 30 Jan 2002 19:43:15 -0000 Message-ID: <037a01c1a9c6$36f529e0$650d07d8@STACCATO> From: "Serge Knystautas" To: "Jakarta Commons Developers List" Subject: HttpClient response size limit Date: Wed, 30 Jan 2002 14:42:12 -0500 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_0377_01C1A99C.4DECC740" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4807.1700 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4807.1700 X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N ------=_NextPart_000_0377_01C1A99C.4DECC740 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Here's a simple patch I needed to fix my problems connecting to a bad webcam webserver (which would occasionally set the Content-Length header to 138 mbs or something ridiculously stupid and bogus like that). To the GetMethod I added getter and setter methods for "responseSizeLimit", and then if it's set, it will cap the expected length. Serge Knystautas Loki Technologies - Unstoppable Websites http://www.lokitech.com/ ------=_NextPart_000_0377_01C1A99C.4DECC740 Content-Type: text/plain; name="diff-response-size-limit.txt" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="diff-response-size-limit.txt" Index: java/org/apache/commons/httpclient/methods/GetMethod.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: = /home/cvs/jakarta-commons/httpclient/src/java/org/apache/commons/httpclie= nt/methods/GetMethod.java,v retrieving revision 1.7 diff -r1.7 GetMethod.java 187a188,192 > /** > * Response limit in bytes > */ > protected int responseSizeLimit =3D -1; >=20 265a271,284 > /** > * Response size limit getter. > */ > public int getResponseSizeLimit() { > return responseSizeLimit; > } >=20 > /** > * Response size limit setter. > */ > public void setResponseSizeLimit(int value) { > responseSizeLimit =3D value; > } >=20 383a403 > //This is set to the response size limit... defaults to -1 = which means unlimited 394a415,417 > } > if (responseSizeLimit > -1 && (expectedLength > = responseSizeLimit || expectedLength =3D=3D -1)) { > expectedLength =3D responseSizeLimit; ------=_NextPart_000_0377_01C1A99C.4DECC740 Content-Type: text/plain; charset=us-ascii -- To unsubscribe, e-mail: For additional commands, e-mail: ------=_NextPart_000_0377_01C1A99C.4DECC740--