Ethereal-dev: [Ethereal-dev] GList issue

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: "fabio matturro" <fabiomax3@xxxxxxxxxxx>
Date: Thu, 09 Feb 2006 16:45:53 +0100
Hi :- )

I'm having some problems dealing with GLists.
I want to attach a GList to a conversation.
This GList contains my private data structure.
The dissector inserts each private data structure into my Glist and then checks for a conversation: if it exists it attaches the update Glist to it otherwise it creates a new
conversation. Here follows the code:
******************************************************************************************
CODE EXECUTED WHEN EXEC PACKET IS SNIFFED:

stdo =malloc (sizeof(stdout_sink_t));/*g_mem_chunk_alloc (stdout_chunks);*/
			stdo->outtid = s->outtid;
			stdo->outtag = s->outtag;
			stdout_list = g_list_append(stdout_list, (stdout_sink_t *)stdo);

			/*check for a conversation*/
conversation = find_conversation (pinfo->fd->num, &pinfo->src, &pinfo->dst, pinfo->ptype, pinfo->srcport, pinfo->destport,0);

			if (conversation) {
				if (!pinfo->fd->flags.visited)
conversation_add_proto_data (conversation, proto_pvm, (void*) stdout_list);
			}
			else {
conversation = conversation_new (pinfo->fd->num, &pinfo->src, &pinfo->dst, pinfo->ptype, pinfo->srcport, pinfo->destport, 0); conversation_add_proto_data (conversation, proto_pvm, (void*) stdout_list);
				g_free(s);
		     }
		  }
*******************************************************************************************

How come that when I use g_list_length it always returns 1 even if several ExEC packets are sniffed?
Thanx

_________________________________________________________________
250MB per la tua casella di posta http://www.msn.it/hotmail/minisite_10 Trova immediatamente qualsiasi tipo di file.