From f16ef2418b6e8e8b0d1aa5794566c3df2f3431b2 Mon Sep 17 00:00:00 2001 From: Ruben Shekspir Date: Sat, 4 May 2019 15:58:17 +0400 Subject: [PATCH] Full file download works --- Internet.Mod | 2 +- http.Mod | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/Internet.Mod b/Internet.Mod index 799bf9f..674b605 100644 --- a/Internet.Mod +++ b/Internet.Mod @@ -37,7 +37,7 @@ BEGIN l := LEN(buf)-1; f := 0; r := Platform.Read(fd, p, l, f); - IF r >= 0 THEN RETURN TRUE ELSE RETURN FALSE END + IF r > 0 THEN RETURN TRUE ELSE RETURN FALSE END END Read; PROCEDURE Connect*(host, port: ARRAY OF CHAR; VAR conn: Socket): BOOLEAN; diff --git a/http.Mod b/http.Mod index f1af3bc..c44dad3 100644 --- a/http.Mod +++ b/http.Mod @@ -1,7 +1,6 @@ MODULE http; IMPORT Strings, Internet, Logger; CONST - MAXARRAYNUMBER = 10000; MAXARRAYNUMBEREXTENDED = 1000000; @@ -61,14 +60,12 @@ BEGIN REPEAT connectionFlag := Internet.Read(socket, tmpBuff); Strings.Append(tmpBuff, buff); - Logger.Log(tmpBuff); UNTIL ~connectionFlag; Internet.Disconnect(socket); END get; BEGIN - get("norayr.am", "/seq.txt", "80", buff); + get("norayr.am", "/gf.jpg", "80", buff); Logger.Log(buff); - END http. \ No newline at end of file