From 53eca560f68b1ed90d7b46df415734aea279b825 Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Wed, 16 Jun 2004 09:25:52 +0000 Subject: [PATCH] Cope with the current situation where PA's servers somehow strip the content-length header even though the servlet container is providing one. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3029 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- .../com/threerings/resource/JNLPDownloader.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/java/com/threerings/resource/JNLPDownloader.java b/src/java/com/threerings/resource/JNLPDownloader.java index 709b6d61e..d6938e7c6 100644 --- a/src/java/com/threerings/resource/JNLPDownloader.java +++ b/src/java/com/threerings/resource/JNLPDownloader.java @@ -1,5 +1,5 @@ // -// $Id: JNLPDownloader.java,v 1.16 2004/02/25 14:49:39 mdb Exp $ +// $Id: JNLPDownloader.java,v 1.17 2004/06/16 09:25:52 mdb Exp $ package com.threerings.resource; @@ -95,10 +95,13 @@ public class JNLPDownloader extends Downloader throw new IOException(errmsg); } - // if we're versioning, we know we need an update - info.totalSize += ucon.getContentLength(); - Log.info(getResourceURL() + " requires " + ucon.getContentLength() + - " byte update."); + // if we're versioning, we know we need an update; force the + // content length to be at least 1 so that we behave marginally + // sensibly (ticking off each file as we download it) if our + // server doesn't provide content-length for some assinine reason + int cl = Math.max(ucon.getContentLength(), 1); + info.totalSize += cl; + Log.info(getResourceURL() + " requires " + cl + " byte update."); return true; }