From b0100868109beedc9eb1dd2185da2e4ba3002ffa Mon Sep 17 00:00:00 2001 From: Cyborgscode Date: Thu, 26 Sep 2024 12:22:51 +0200 Subject: [PATCH] Update HTTP.java --- io/HTTP.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/io/HTTP.java b/io/HTTP.java index be4673d..494afcb 100644 --- a/io/HTTP.java +++ b/io/HTTP.java @@ -41,20 +41,21 @@ static private String readPage(Socket socket, boolean header) throws IOException // System.out.println("readPage: pre read " + dis.available() ); if ( dis.available() > 0 || firstread ) { - got = dis.read(buffer,offset,len-offset); + + got = dis.read(buffer,offset,len-offset); // System.out.println("readPage: read = "+got); offset += got; firstread = false; - if ( offset == len ) { + if ( offset >= len ) { result += new String(buffer); offset = 0; } } else break; - } while ( got > 0 ); + } while ( got > 0); // System.out.println("readPage: finish reading normally");