-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nitcorn: fix bug with binary files #1817
Conversation
if err then | ||
last_error = new IOError("Failed to add file at '{path}'") | ||
file.close | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
quite convoluted, only the FileReaded.open
seems necesarry, the initial file_exist
is useless since the error will be caugut latter. And the file_stat sould be replaced by a FileStream::stat
or something that use the POSIX fstat
internally.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I'm not mistaken file.file_stat
already uses fstat
. But l'll remove the file_exist
check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
re +1 then
+1 |
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Rerolled to remove the |
Downloading binary files from a nitcorn server works as expected once again. The API should be enough for most users but there is a few features lacking. Namely alternating custom text with files and writing custom data. We could merge the `body` and `files` attributes into a sequence of `Bytables` to send, with support for `Bytes`. You can test the result on xymus.net, either by downloading the latest WBTW at http://xymus.net/pub/wbtw-v0.4-110-g668b261.tar.gz or by playing a clone of Super Hexagon (mostly made by @ablondin) at http://xymus.net/pub/hex/. Pull-Request: #1817 Reviewed-by: Jean Privat <jean@pryen.org>
Downloading binary files from a nitcorn server works as expected once again.
The API should be enough for most users but there is a few features lacking. Namely alternating custom text with files and writing custom data. We could merge the
body
andfiles
attributes into a sequence ofBytables
to send, with support forBytes
.You can test the result on xymus.net, either by downloading the latest WBTW at http://xymus.net/pub/wbtw-v0.4-110-g668b261.tar.gz or by playing a clone of Super Hexagon (mostly made by @ablondin) at http://xymus.net/pub/hex/.