Return-Path: X-Original-To: apmail-tomcat-users-archive@www.apache.org Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1FBEAD28E for ; Tue, 31 Jul 2012 21:32:35 +0000 (UTC) Received: (qmail 55564 invoked by uid 500); 31 Jul 2012 21:32:31 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 55274 invoked by uid 500); 31 Jul 2012 21:32:31 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 55265 invoked by uid 99); 31 Jul 2012 21:32:31 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 31 Jul 2012 21:32:31 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of knst.kolinko@gmail.com designates 209.85.220.173 as permitted sender) Received: from [209.85.220.173] (HELO mail-vc0-f173.google.com) (209.85.220.173) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 31 Jul 2012 21:32:25 +0000 Received: by vcbfl15 with SMTP id fl15so7782184vcb.18 for ; Tue, 31 Jul 2012 14:32:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=vzS3c9NJiYiaFxFYuEaUUvnR+kdSAo8sYAH5j+rTjg4=; b=fHFi6FSUClT+CvyMovuB+TlxCl/396slst8jQK53xzdiWaNNywM87D8XxEnYH/1lJu LZ5Qarl1WxQvdCg/aMhpQKXTpgBrhE+9+QS+FtzTw/Wh/O4ZiKdFPDQEFiotyIATpXdB mk07IpBSWpWNDBE3vrejANyawam81fH/HUcHb+7HJANf3FQyVLHtou2ZIiAV5PZwhtSW 0CRsVIKQrsEA7YY3YOj+D1KckR/ViJxPR7eeZL03j54rvC1bmGmi9M13+XCnNjN3ylVa akq4LlwvfvL5SBxBdC8PPeHoeOspdHK5po46tIZRcELuPDEo5xxn/AmNle0XULW3r6VS uc3g== MIME-Version: 1.0 Received: by 10.220.219.7 with SMTP id hs7mr15413153vcb.0.1343770324043; Tue, 31 Jul 2012 14:32:04 -0700 (PDT) Received: by 10.58.0.35 with HTTP; Tue, 31 Jul 2012 14:32:03 -0700 (PDT) In-Reply-To: References: <5017C1D3.5030608@ice-sa.com> Date: Wed, 1 Aug 2012 01:32:03 +0400 Message-ID: Subject: Re: PDF Download problem tomcat >= 7.0.27 From: Konstantin Kolinko To: Tomcat Users List Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org 2012/8/1 Jose Mar=EDa Zaragoza : >> The Content-Length header in the above 206 response is not from Tomcat. >> >> Tomcat's DefaultServlet does not calculate the whole size of the parts >> and does not set content-length, and the file size is much more than >> fits into the buffer. >> So it would use Transfer-Encoding: chunked in its response and not >> the one that you cited. >> There must be some proxy in the way that buffers the data and sends >> them as one response instead of chunks. HTTPD? Was there some option >> in it that disables chunked encoding when interacting with IE? > > > Well, i don't know so much, but that doesn't have to do with chunked > encoding, but Partial Content support, right ? > And partial content is requested by client (IE) if Content-length is > very big ( I guess ... ) > Maybe, IE requests a PDF file (GET) and if it sees a Content-length > very big , cuts downloading and re-send a GET request with a range of > bytes. > > Chrome looks to perform something like that behaviour > 1. I suspect that the content is requested not by IE, but by the Adobe Acrobat plugin. The "User-Agent" header says that it was IE6, but it is hard to imagine why the browser by itself would request that strange bytes range, asking for the tail of the file first. So there is something else that uses the browser to perform the request. 2. To clarify what I said about chunked encoding: Tomcat itself does not know the size of data that it sends. So if the response is HTTP/1.1, the response will be send using "Transfer-Encoding: chunked" in blocks of bytes (chunks) each prefixed with the size of the block, up to the terminating block of size 0. It is a feature of HTTP/1.1 protocol. If something sends "Content-Length: 1319458" response header, it must calculate the size of data, and it can be only done by caching the whole of response sent by Tomcat. The response headers will not be sent before the whole data is cached, so the client will observe a delay. I think there is a possibility that the client can time-out. Best regards, Konstantin Kolinko --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org