Full file download works

This commit is contained in:
Ruben Shekspir 2019-05-04 15:58:17 +04:00
parent a3ce2fdcab
commit f16ef2418b
2 changed files with 2 additions and 5 deletions

View file

@ -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;

View file

@ -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.