[Pkg-privacy-commits] [libotr] 110/225: Avoid improperly updating recent_sent_child field
Ximin Luo
infinity0 at moszumanska.debian.org
Sat Aug 22 12:45:06 UTC 2015
This is an automated email from the git hooks/post-receive script.
infinity0 pushed a commit to branch master
in repository libotr.
commit fcce387a09a8daa3ee69cf82a885e89da4842eb6
Author: Ian Goldberg <iang at cs.uwaterloo.ca>
Date: Sat Aug 25 15:45:39 2012 -0400
Avoid improperly updating recent_sent_child field
Don't update the recent_sent_child field to point to the master context
just becuase we sent a version 3 COMMIT message (which has no
destination instance).
---
ChangeLog | 4 ++++
src/message.c | 10 ++++++++--
2 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 2f814f5..0ae34dd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -13,6 +13,10 @@
* src/message.c: Correct the logic for handling incoming COMMIT
messages when we've recently sent our own COMMIT message.
+ * src/message.c: Don't update the recent_sent_child field to
+ point to the master context just becuase we sent a version 3
+ COMMIT message (which has no destination instance).
+
2012-08-24
* README:
diff --git a/src/message.c b/src/message.c
index 7cd925f..0b9c7ba 100644
--- a/src/message.c
+++ b/src/message.c
@@ -451,8 +451,14 @@ static gcry_error_t send_or_error_auth(const OtrlMessageAppOps *ops,
if (msg && *msg) {
fragment_and_send(ops, opdata, context, msg,
OTRL_FRAGMENT_SEND_ALL, NULL);
- context->context_priv->lastsent = time(NULL);
- otrl_context_update_recent_child(context, 1);
+ /* Update the "last sent" fields, unless this is a version 3
+ * message typing to update the master context (as happens
+ * when sending a v3 COMMIT message, for example). */
+ if (context != context->m_context ||
+ context->auth.protocol_version != 3) {
+ context->context_priv->lastsent = time(NULL);
+ otrl_context_update_recent_child(context, 1);
+ }
}
} else {
if (ops->handle_msg_event) {
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/libotr.git
More information about the Pkg-privacy-commits
mailing list