-
-
Notifications
You must be signed in to change notification settings - Fork 53
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
Fix indexer finishing too soon #23
Conversation
Looks like the unit test for the indexer is failing because the result array is now in a different order. Should I rewrite the test to compare the arrays in any order, or does the order matter in any way? edit Test now passes |
Did you bump up diff --git a/fist/server.c b/fist/server.c
index bd889f1..43ab062 100644
--- a/fist/server.c
+++ b/fist/server.c
@@ -18,7 +18,7 @@
// TODO: extract to config file?
#define MAX_PHRASE_LENGTH 10
-#define READ_MAX 1024
+#define READ_MAX 16384
#define SO_BACKLOG 10
#define SAVE_SECONDS 120 |
I've rebased to include the fix for longer commands, can you try it now? |
So just tested this and it works, but there is another bug that has come up. There's a malloc error that pops up after indexing a few different text blocks. The most reliable way to cause the error is with the following code:
This cases the error below I tested this with release version 0.0.1 and the error does not occur. After looking over the code and doing some testing I found that the error is occurring in https://github.com/00-matt/fist/blob/fix-18/fist/server.c#L250 |
It looks like this happens when multiple commands are sent at the same time. If you quickly send commands in quick succession (so that they fit in the same I think that the best solution would be to split the buffer on |
Ah, okay that makes sense. So this a separate issue anyway. This PR seems to fix the original problem. I will merge it if you have no other changes to make, let me know. |
I am going to merge this. |
Fixes #18