From 3777efae20f5f94c011908303245ae89e89b05c0 Mon Sep 17 00:00:00 2001 From: Richard Aas Date: Wed, 26 Jan 2011 13:32:32 +0000 Subject: [PATCH] more ICE fixes --- include/re_ice.h | 1 + src/ice/connchk.c | 5 +++-- src/ice/gather.c | 14 +++++++------- src/ice/ice.h | 1 - src/ice/stunsrv.c | 8 ++++++-- 5 files changed, 17 insertions(+), 12 deletions(-) diff --git a/include/re_ice.h b/include/re_ice.h index 1bc0508..ffd3496 100644 --- a/include/re_ice.h +++ b/include/re_ice.h @@ -59,6 +59,7 @@ int icem_gather_relay(struct icem *icem, const struct sa *stun_srv, const char *username, const char *password); bool icem_verify_support(struct icem *icem, uint8_t compid, const struct sa *raddr); +int icem_conncheck_start(struct icem *icem); int icem_add_chan(struct icem *icem, uint8_t compid, const struct sa *raddr); bool icem_mismatch(const struct icem *icem); void icem_update(struct icem *icem); diff --git a/src/ice/connchk.c b/src/ice/connchk.c index 46e1b84..b503d18 100644 --- a/src/ice/connchk.c +++ b/src/ice/connchk.c @@ -386,8 +386,9 @@ int icem_conncheck_start(struct icem *icem) icem->state = CHECKLIST_RUNNING; - DEBUG_NOTICE("starting connectivity checks with %u candidate pairs\n", - list_count(&icem->checkl)); + DEBUG_NOTICE("%s: starting connectivity checks" + " with %u candidate pairs\n", + icem->name, list_count(&icem->checkl)); #if 0 (void)re_printf("%H\n", icem_debug, icem); #endif diff --git a/src/ice/gather.c b/src/ice/gather.c index 3a827fc..4f119f0 100644 --- a/src/ice/gather.c +++ b/src/ice/gather.c @@ -17,7 +17,7 @@ #include "ice.h" -#define DEBUG_MODULE "ice_gather" +#define DEBUG_MODULE "icegath" #define DEBUG_LEVEL 5 #include @@ -64,8 +64,8 @@ static void stun_resp_handler(int err, uint16_t scode, const char *reason, --icem->nstun; if (err || scode > 0) { - DEBUG_WARNING("{%u} STUN Request failed: %s\n", - comp->id, strerror(err)); + DEBUG_WARNING("{%s.%u} STUN Request failed: %s\n", + icem->name, comp->id, strerror(err)); goto out; } @@ -123,14 +123,14 @@ static void turnc_handler(int err, uint16_t scode, const char *reason, --icem->nstun; if (err) { - DEBUG_WARNING("{%d} TURN Client error: %s\n", - comp->id, strerror(err)); + DEBUG_WARNING("{%s.%d} TURN Client error: %s\n", + icem->name, comp->id, strerror(err)); goto out; } if (scode) { - DEBUG_WARNING("{%d} TURN Client error: %u %s\n", - comp->id, scode, reason); + DEBUG_WARNING("{%s.%d} TURN Client error: %u %s\n", + icem->name, comp->id, scode, reason); err = send_binding_request(icem, comp); if (err) goto out; diff --git a/src/ice/ice.h b/src/ice/ice.h index 506eb5b..1382131 100644 --- a/src/ice/ice.h +++ b/src/ice/ice.h @@ -215,7 +215,6 @@ void icecomp_printf(struct icem_comp *comp, const char *fmt, ...); /* conncheck */ -int icem_conncheck_start(struct icem *icem); void icem_conncheck_schedule_check(struct icem *icem); void icem_conncheck_continue(struct icem *icem); void icem_conncheck_stop(struct icem *icem); diff --git a/src/ice/stunsrv.c b/src/ice/stunsrv.c index 52cbc20..70844bc 100644 --- a/src/ice/stunsrv.c +++ b/src/ice/stunsrv.c @@ -142,7 +142,9 @@ static void handle_stun(struct ice *ice, struct icem *icem, int err; if (icem->state != CHECKLIST_RUNNING) { - DEBUG_WARNING("Checklist is not running \n"); + DEBUG_WARNING("%s.%u: Checklist is not running (%s)\n", + icem->name, comp->id, + ice_checkl_state2name(icem->state)); } /* 7.2.1.3. Learning Peer Reflexive Candidates */ @@ -168,7 +170,9 @@ static void handle_stun(struct ice *ice, struct icem *icem, } if (!lcand) { - DEBUG_WARNING("%s: local candidate not found\n", icem->name); + DEBUG_WARNING("%s.%u: local candidate not found (checkl=%u)\n", + icem->name, comp->id, + list_count(&icem->checkl)); } /* 7.2.1.4. Triggered Checks */