fix: Remove debug logging that interfered with expect tests
This commit is contained in:
@@ -21,6 +21,7 @@
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <glib.h>
|
||||
|
||||
#include <string.h>
|
||||
@@ -105,5 +106,9 @@ prime_for_query(const char *query, char *stream)
|
||||
XMPPStanza*
|
||||
prime_get_for_query(const char *query)
|
||||
{
|
||||
if (!querystubs) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return g_hash_table_lookup(querystubs, query);
|
||||
}
|
||||
|
||||
@@ -67,6 +67,10 @@ static void* _start_server_cb(void* userdata);
|
||||
void
|
||||
write_stream(const char * const stream)
|
||||
{
|
||||
if (!client) {
|
||||
return;
|
||||
}
|
||||
|
||||
int to_send = strlen(stream);
|
||||
char *marker = (char*)stream;
|
||||
|
||||
@@ -252,6 +256,7 @@ query_callback(const char *query, const char *id)
|
||||
log_println(STBBR_LOGINFO, "--> QUERY callback fired for '%s'", query);
|
||||
stanza_set_id(stanza, id);
|
||||
char *stream = stanza_to_string(stanza);
|
||||
|
||||
write_stream(stream);
|
||||
free(stream);
|
||||
}
|
||||
|
||||
@@ -75,25 +75,15 @@ stanzas_verify_any(XMPPStanza *stanza)
|
||||
return 0;
|
||||
}
|
||||
|
||||
char *expected_str = stanza_to_string(stanza);
|
||||
fprintf(stderr, "DEBUG verify_any: Looking for: %s\n", expected_str);
|
||||
free(expected_str);
|
||||
|
||||
GList *curr = g_list_last(stanzas);
|
||||
int idx = g_list_length(stanzas) - 1;
|
||||
while (curr) {
|
||||
XMPPStanza *curr_stanza = curr->data;
|
||||
char *curr_str = stanza_to_string(curr_stanza);
|
||||
fprintf(stderr, "DEBUG verify_any: [%d] %s\n", idx, curr_str);
|
||||
free(curr_str);
|
||||
|
||||
if (_stanzas_equal(stanza, curr_stanza) == 0) {
|
||||
pthread_mutex_unlock(&stanzas_lock);
|
||||
return 1;
|
||||
}
|
||||
|
||||
curr = g_list_previous(curr);
|
||||
idx--;
|
||||
}
|
||||
|
||||
pthread_mutex_unlock(&stanzas_lock);
|
||||
|
||||
@@ -170,7 +170,10 @@ _end_element(void *data, const char *element)
|
||||
return;
|
||||
}
|
||||
|
||||
log_println(STBBR_LOGINFO, "RECV: %s", curr_string->str);
|
||||
char *stanza_str = stanza_to_string(curr_stanza);
|
||||
log_println(STBBR_LOGINFO, "RECV: %s", stanza_str);
|
||||
free(stanza_str);
|
||||
|
||||
stanzas_add(curr_stanza);
|
||||
|
||||
// Clear the string buffer for the next stanza
|
||||
|
||||
Reference in New Issue
Block a user