4 Commits

Author SHA1 Message Date
fdb615a213 feat: Add stbbr_for_presence_to for MUC join presence matching
- Add prime_for_presence_to() and prime_get_for_presence_to() in prime.c
- Add presence_to_callback() in server.c to handle MUC join presence
- Export stbbr_for_presence_to() in stabber.h
- Add stanzas_debug_last() for debugging failed verifications
2025-12-06 15:06:02 +03:00
d09adad0e1 fix: Remove debug logging that interfered with expect tests 2025-12-03 02:38:33 +03:00
0c38ca0c50 fix: Fix XMPP stream parsing depth tracking and add debug logging
- Reset depth counter in parser_init() to fix stanza parsing between connections
- Properly track depth for virtual wrapper element
- Add debug logging in stanzas_verify_any() to trace stanza matching
2025-12-02 19:42:40 +03:00
14b664f4c7 fix: Fix XMPP stream parsing for multiple stanzas
- Add special handling for <stream:stream> (unclosed root element)
- Feed virtual <wrapper> element to allow multiple root stanzas
- Support non-<query/> IQ payloads like <ping/> (XEP-0199)
- Relax stanza matching: allow extra attrs/children in received
- Add legacy auth feature in stream:features
- Use larger read buffer (1024 bytes) for efficiency
- Clear curr_string buffer after each stanza
2025-12-02 18:21:47 +03:00
2 changed files with 1 additions and 5 deletions

View File

@@ -299,9 +299,7 @@ stanza_parse(char *stanza_text)
XML_Parse(parser, stanza_text, strlen(stanza_text), 0);
XML_ParserFree(parser);
XMPPStanza *result = state->curr_stanza;
free(state);
return result;
return state->curr_stanza;
}
static void

View File

@@ -63,7 +63,6 @@ verify_any(char *stanza_text, gboolean ign_timeout)
usleep(1000 * 50);
elapsed = g_timer_elapsed(timer, NULL);
}
g_timer_destroy(timer);
}
if (result) {
@@ -95,7 +94,6 @@ verify_last(char *stanza_text)
usleep(1000 * 50);
elapsed = g_timer_elapsed(timer, NULL);
}
g_timer_destroy(timer);
}
if (result) {