Skip to content
Snippets Groups Projects
Commit 85dd8b01 authored by rswindell's avatar rswindell
Browse files

Issue a QWK-packet-received confirmation request after a successful download

of a QWK packet (sending the received-file-length as a post parameter):
 http[s]://host/qwk.ssjs?received=<length>
If the file size matches the user's QWK packet size, the local (server-side)
QWK packet is deleted.
Passing an empty string to HTTPRequest.Post() since it requires a data
paramater. :-( Using Post rather than Get 'cause the chicken hath spake:
"<echicken> I think POST is probably technically the more correct way to do it"
parent 45ff2baa
No related branches found
No related tags found
No related merge requests found
......@@ -48,8 +48,10 @@ function send_rep(rep)
alert(http.request + " Response: " + http.status_line);
return false;
}
if(!file_remove(rep))
if(!file_remove(rep)) {
log(LOG_ERR, "Error removing file: " + rep);
return false;
}
return true;
}
......@@ -75,7 +77,8 @@ function receive_qwk(qwk)
else {
print("Received " + contents.length + " bytes");
file.write(contents);
success = true;
http.Post(url + '?received=' + file.position, '');
success = (http.response_code == HTTP_RESPONSE_NO_CONTENT);
}
file.close();
return success;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment