Conversation
f6871c4 to
5fb02b1
Compare
vikman90
requested changes
Mar 23, 2018
| keys->keyentries[i]->inode = File_Inode(rids_file); | ||
|
|
||
| /* If nothing is there, try to open as write only */ | ||
| if (!keys->keyentries[i]->fp) { |
Member
There was a problem hiding this comment.
Missing File_Inode() here, if fopen() failed. This call may be better after ending the if block (just like you did in ReloadCounter().
| } | ||
|
|
||
| /* Reload the global and local count of events */ | ||
| static void ReloadCounter(const keystore *keys, int id, const char * cid) |
Member
There was a problem hiding this comment.
This function does not update global_count or local_count. Those variables must be updated instead of the agent counters in the case that id==keysize.
| keys->keyentries[id]->local = msg_local; | ||
|
|
||
| if (rcv_count >= _s_recv_flush) { | ||
| ReloadCounter(keys, id, keys->keyentries[id]->id); |
Member
There was a problem hiding this comment.
The agent counter must be updated before comparing the message counter.
| msg_encrypted[OS_MAXSTR] = '\0'; | ||
|
|
||
| if (snd_count >= _s_recv_flush) { | ||
| ReloadCounter(keys, keys->keysize, SENDER_COUNTER); |
Member
There was a problem hiding this comment.
This call must update global_counter and local_counter.
vikman90
approved these changes
Mar 23, 2018
Member
|
GJ @bah07 !! |
This file contains hidden or 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
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 PR add feature related issue #456
ino_t inodeto store each agent's counter inodeReloadCounterfunction checks if the inode of the file has changed, if so, reloads the corresponding counters.