summaryrefslogtreecommitdiff
path: root/src/process.c
diff options
context:
space:
mode:
authorAdam Jackson <ajax@nwnk.net>2005-10-23 20:12:19 +0000
committerAdam Jackson <ajax@nwnk.net>2005-10-23 20:12:19 +0000
commitc361e3919f2de3f4742904b04e73178edc76bf95 (patch)
tree262e17a1820bc82f87b5f9e5501b5d287c04e670 /src/process.c
parent0b8ff6fbd8cd7f47ab9e6ccb6d4917564a2d13ee (diff)
Bug #1893: Fix replies when peers use different major opcodes for the sameXORG-6_8_99_903XORG-6_8_99_902
subprotocol. (016_ICE_subprotocol_reply_fix.diff from Debian, by Jochen Voss)
Diffstat (limited to 'src/process.c')
-rw-r--r--src/process.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/src/process.c b/src/process.c
index a6823e9..2a97dcb 100644
--- a/src/process.c
+++ b/src/process.c
@@ -250,16 +250,33 @@ Bool *replyReadyRet;
_IceAddReplyWait (iceConn, replyWait);
-
/*
* Note that there are two different replyWaits. The first is
* the one passed into IceProcessMessages, and is the replyWait
* for the message the client is blocking on. The second is
* the replyWait for the message currently being processed
* by IceProcessMessages. We call it "useThisReplyWait".
+ *
+ * Also, when two hosts communicate over an ICE connection and use
+ * different major opcodes for a subprotocol, it is impossible
+ * to use message replies unless we translate opcodes before
+ * comparing them.
*/
+
+ {
+ int op;
- useThisReplyWait = _IceSearchReplyWaits (iceConn, header->majorOpcode);
+ if (header->majorOpcode == 0)
+ {
+ op = 0;
+ }
+ else
+ {
+ int idx = header->majorOpcode - iceConn->his_min_opcode;
+ op = iceConn->process_msg_info[idx].my_opcode;
+ }
+ useThisReplyWait = _IceSearchReplyWaits (iceConn, op);
+ }
}
if (header->majorOpcode == 0)