summaryrefslogtreecommitdiff
path: root/agent/conncheck.h
diff options
context:
space:
mode:
authorFabrice Bellet <fabrice@bellet.info>2017-06-26 21:41:44 +0200
committerOlivier CrĂȘte <olivier.crete@collabora.com>2017-09-05 15:00:55 -0400
commit36f306f4a95f1c2b3e9c584b5a645a78e231c020 (patch)
treec01802907d5790498f94d2abe13ed8b7cdd5cd40 /agent/conncheck.h
parente860948b5fe3a791119957f26045b8f5159baeff (diff)
downloadlibnice-36f306f4a95f1c2b3e9c584b5a645a78e231c020.tar.gz
conncheck: support several stun requests per pair
This patch should improve the reliabily of the connection check by keeping the record of several simultaneous ongoing stun requests per pair. A new stun request on an in-progress pair typically is caused by in inbound stun request from the peer on this same pair. This is named "Triggered Checks" in the spec. When this situation arises, it is fair to handle these two stun requests simultaneously, the triggered check, and the initial ordinary check, since both can potentially succeed. Differential Revision: https://phabricator.freedesktop.org/D1761
Diffstat (limited to 'agent/conncheck.h')
-rw-r--r--agent/conncheck.h21
1 files changed, 13 insertions, 8 deletions
diff --git a/agent/conncheck.h b/agent/conncheck.h
index 909d469..e16dc67 100644
--- a/agent/conncheck.h
+++ b/agent/conncheck.h
@@ -71,6 +71,15 @@ typedef enum
} NiceCheckState;
typedef struct _CandidateCheckPair CandidateCheckPair;
+typedef struct _StunTransaction StunTransaction;
+
+struct _StunTransaction
+{
+ GTimeVal next_tick; /* next tick timestamp */
+ StunTimer timer;
+ uint8_t buffer[STUN_MAX_MESSAGE_SIZE_IPV6];
+ StunMessage message;
+};
struct _CandidateCheckPair
{
@@ -86,16 +95,12 @@ struct _CandidateCheckPair
gboolean valid;
gboolean use_candidate_on_next_check;
gboolean mark_nominated_on_response_arrival;
- gboolean recheck_on_timeout;
- gboolean retransmit_on_timeout;
- struct _CandidateCheckPair *discovered_pair;
- struct _CandidateCheckPair *succeeded_pair;
+ gboolean retransmit; /* if the first stun request must be retransmitted */
+ CandidateCheckPair *discovered_pair;
+ CandidateCheckPair *succeeded_pair;
guint64 priority;
guint32 prflx_priority;
- GTimeVal next_tick; /* next tick timestamp */
- StunTimer timer;
- uint8_t stun_buffer[STUN_MAX_MESSAGE_SIZE_IPV6];
- StunMessage stun_message;
+ GSList *stun_transactions; /* a list of ongoing stun requests */
};
int conn_check_add_for_candidate (NiceAgent *agent, guint stream_id, NiceComponent *component, NiceCandidate *remote);