Patches for slow connect speed from dirkthedaring2

This commit is contained in:
Ron Pedde 2005-01-24 01:05:00 +00:00
parent 07e0490120
commit 5555707a6d
3 changed files with 9 additions and 12 deletions

View File

@ -65,4 +65,3 @@ Ciamac Moallemi
Roger Mundt
* troubleshooting and debugging help

View File

@ -159,6 +159,7 @@ DAAP_BLOCK *daap_get_new(void) {
pnew->value=NULL;
pnew->parent=NULL;
pnew->children=NULL;
pnew->last_child=NULL;
pnew->next=NULL;
return pnew;
@ -198,17 +199,13 @@ DAAP_BLOCK *daap_add_formatted(DAAP_BLOCK *parent, char *tag,
/* walk the child list and put it at the end */
if(parent) {
current=last=parent->children;
while(current) {
last=current;
current=current->next;
}
if(last) { /* some there already */
last = parent->last_child;
if (last) {
last->next = pnew;
} else {
parent->children = pnew;
}
parent->last_child = pnew;
}
/* now, walk the chain and update sizes */

View File

@ -51,6 +51,7 @@ typedef struct daap_block_tag {
char svalue[4]; /* for statics up to 4 bytes */
struct daap_block_tag *parent;
struct daap_block_tag *children;
struct daap_block_tag *last_child;
struct daap_block_tag *next;
} DAAP_BLOCK;