Added stbbr_wait_for

This commit is contained in:
James Booth
2015-05-30 22:43:28 +01:00
parent 7ae9fe8466
commit e8ca581eea
6 changed files with 50 additions and 0 deletions

View File

@@ -177,6 +177,20 @@ id_callback(const char *id)
}
}
void
server_wait_for(char *id)
{
log_println("WAIT for stanza with id: %s", id);
while (TRUE) {
int res = stanzas_contains_id(id);
if (res) {
log_println("WAIT complete for id: %s", id);
return;
}
usleep(1000 * 50);
}
}
void*
_start_server_cb(void* userdata)
{
@@ -321,6 +335,7 @@ server_stop(void)
static void
_shutdown(void)
{
log_println("SHUTDOWN");
// stanza_show_all();
xmppclient_end_session(client);
client = NULL;