Changeset eab2ac4
- Timestamp:
- 2006-09-25T07:42:39Z (18 years ago)
- Branches:
- master
- Children:
- ebe7b36
- Parents:
- a214954
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/jabber/jabber.c
ra214954 reab2ac4 179 179 { 180 180 struct jabber_data *jd = gc->proto_data; 181 struct xt_node *c, * prev;181 struct xt_node *c, *tmp; 182 182 183 183 /* Just any whitespace character is enough as a keepalive for XMPP sessions. */ … … 194 194 /* This horrible loop is explained in xmltree.c. Makes me wonder if maybe I 195 195 didn't choose the perfect data structure... */ 196 for( prev = NULL, c = jd->node_cache->children; c; prev = c, c = c ? c->next : jd->node_cache->children ) 197 { 198 if( c->flags == 0 ) 199 { 200 c->flags ++; 201 } 202 else 203 { 204 if( prev ) 205 prev->next = c->next; 206 else 207 jd->node_cache->children = c->next; 208 209 xt_free_node( c ); 210 c = prev; 211 } 196 for( c = jd->node_cache->children; c; c = c->next ) 197 if( !( c->flags & XT_SEEN ) ) 198 break; 199 200 /* Now c points at the first unflagged node (or at NULL). Clean up 201 everything until that point. */ 202 while( jd->node_cache->children != c ) 203 { 204 /* 205 printf( "Cleaning up:\n" ); 206 xt_print( jd->node_cache->children ); 207 */ 208 209 tmp = jd->node_cache->children->next; 210 xt_free_node( jd->node_cache->children ); 211 jd->node_cache->children = tmp; 212 } 213 214 /* Now flag the ones that were still unflagged. */ 215 for( c = jd->node_cache->children; c; c = c->next ) 216 { 217 /* 218 printf( "Flagged:\n" ); 219 xt_print( c ); 220 */ 221 222 c->flags |= XT_SEEN; 212 223 } 213 224 }
Note: See TracChangeset
for help on using the changeset viewer.