Http fetch to file doesn't work for some reason

This commit is contained in:
Ruben Shekspir 2019-05-05 13:58:18 +04:00
parent ab197c6483
commit 6c66d03769
6 changed files with 54 additions and 21 deletions

View file

@ -2,21 +2,28 @@ MODULE PackageFileParser;
IMPORT
JsonParser,
FileManager,
http,
Logger;
CONST
MAXARRAYNUMBER = 1000;
MAXARRAYNUMBER = 1000000;
PROCEDURE install*;
VAR
fileData: ARRAY MAXARRAYNUMBER OF CHAR;
successfullyParsed: BOOLEAN;
fileData, buff, buff2: ARRAY MAXARRAYNUMBER OF CHAR;
success: BOOLEAN;
BEGIN
Logger.Log("Starting install process");
successfullyParsed := FileManager.Read("VersionFile.json", fileData);
success := FileManager.Read("VersionFile.json", fileData);
IF ~successfullyParsed THEN Logger.Log("Some ERROR occured while reading VERSIONFILE") END;
ASSERT(successfullyParsed);
IF ~success THEN Logger.Log("Some ERROR occured while reading VERSIONFILE") END;
ASSERT(success);
Logger.Log(fileData);
http.get("norayr.am", "/tmp/", "80", buff);
http.getClean(buff, buff2);
success := FileManager.Write("index.html", buff2);
IF ~success THEN Logger.Log("Some ERROR occured while writing to test gile") END;
ASSERT(success)
END install;
BEGIN