-
Notifications
You must be signed in to change notification settings - Fork 6
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
Use erlang term format instead of ascii #13
Open
hrefhref
wants to merge
24
commits into
evadne:develop
Choose a base branch
from
hrefhref:ei
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
joaothallis
reviewed
May 13, 2020
Closed
Apparently the [example on erlang.org](https://erlang.org/doc/tutorial/erl_interface.html) is wrong for specific lengths of packets...
Checked with Valgrind and everything seems nice. |
A test is failing on travis only, see #17. Otherwise tests are OK. |
Also: - Adds `GenMagic.Server.recycle` and `GenMagic.Server.reload` which allows to restart/reload the apprentice server with a new set of databases, - Fix compilation on musl based distributions (was caused by the args code), - Handle timeouts better in `GenMagic.Server` - Force the port to close in recycling if the graceful stop timeouts
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This changes
apprentice.c
to use the erl_interface/ei.h instead of ascii.Probably also fixes a possible buffer overflow in the old process_line, and will work with the maximum path length (4096).
Magic errors now try to uses
magic_errno
to have more generic errors (for example, my libmagic wasn't returning the same string as yours ("unable to access file").perform/3
calls now support passing a binary instead of a file path ({:bytes, ...}
).The databases are now loaded by using message passing and not arguments.
Added
GenMagic.Server.recycle
andGenMagic.Server.reload
which allows to manually recycle/reload the port, and also loading a new set of databases.Fixes building on musl (was related to the arguments code, see #16, #18).
Handle timeouts a bit nicer in server.
Handle a recycle stop timeout by forcing the port close.
Added tests dedicated to the port.
Tested on: MacOS, FreeBSD, Alpine, Ubuntu, Debian, Fedora, Voidlinux. TODO: Open/Net BSD.