Commit Graph

14 Commits

Author SHA1 Message Date
da7b32cbba fix: Resolve memory leak in verify_any and verify_last by destroying GTimer
The GTimer objects created in verify_any() and verify_last() functions
were never freed, causing memory leaks detected by Valgrind.

This fix adds g_timer_destroy(timer) calls after the while loops to
properly release the allocated timer resources.
2025-12-24 16:25:39 +03:00
00f47a1598 fix: Fix XMPP stream parsing and add stbbr_for_presence_to helper (#1)
This PR fixes critical issues with XMPP stream parsing and adds a new helper function for MUC testing.

## Changes

### 1. Fix XMPP stream parsing for multiple stanzas
The XML parser was not correctly handling multiple consecutive stanzas in the stream. Fixed depth tracking to properly detect stanza boundaries.

### 2. Fix XMPP stream parsing depth tracking
Added proper depth tracking for nested XML elements to correctly identify when a complete stanza has been received.

### 3. Remove debug logging that interfered with expect tests
Removed verbose debug output that was causing expect-based functional tests to fail due to unexpected output in the stream.

### 4. Add `stbbr_for_presence_to` for MUC join presence matching
New helper function that registers a canned response for presence stanzas based on the `to` attribute. This is essential for testing MUC (Multi-User Chat) join flows where the response must be triggered by presence to a specific room JID.

**API:**
```c
void stbbr_for_presence_to(const char *to, const char *response);

Reviewed-on: jabber.developer2/stabber#1
Co-authored-by: jabber.developer2 <jabber.developer2@jabber.space>
Co-committed-by: jabber.developer2 <jabber.developer2@jabber.space>
2025-12-15 08:45:38 +00:00
James Booth
3733390d0f Added verify to http api 2015-06-14 01:39:21 +01:00
James Booth
954d3a2128 Moved logging, added log level paramater to standalone runner 2015-06-08 22:18:48 +01:00
James Booth
d25f8c9acb Use log levels 2015-06-07 19:14:12 +01:00
James Booth
b1a9f6470b Renamed parse_stanza -> stanza_parse 2015-06-06 23:06:00 +01:00
James Booth
2d83c6f732 Reuse stanza parsing code 2015-06-06 23:03:32 +01:00
James Booth
35babf392f Renamed stanza verification functions 2015-06-06 23:00:05 +01:00
James Booth
ddd1bf99a4 Moved stanza data structures 2015-06-06 22:37:50 +01:00
James Booth
6522e94977 Renamed stanza -> stanzas 2015-06-06 22:22:18 +01:00
James Booth
6afa417667 Added license 2015-06-01 00:38:11 +01:00
James Booth
bb9b49a8ea Made verifications blocking calls with timeout 2015-05-27 22:41:51 +01:00
James Booth
0d1ba9500c Added verify any 2015-05-24 19:23:38 +01:00
James Booth
d84e50bccd Added verify for last received stanza 2015-05-24 18:34:21 +01:00