Ethereal-dev: Re: [Ethereal-dev] Patch for packet-tds.c (re-send)

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

From: Guy Harris <guy@xxxxxxxxxxxx>
Date: Thu, 5 Feb 2004 19:28:47 -0800

On Feb 5, 2004, at 11:48 AM, Yaniv Kaul wrote:

Attached diff against today's CVS packet-tds.c

Checked in...

 static void
-dissect_tds_query_packet(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) +dissect_tds_query_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)

...but with the _U_ left in. Is the intent to have "dissect_tds_query_packet()" set the columns or otherwise use "pinfo" eventually? If so, perhaps the _U_ should be removed as a reminder; if not, that argument should probably be removed.

 	for(i=0; i != num_columns; i++) {
+		proto_tree_add_text(tree, tvb, offset, 0, "Column %d", i + 1);
proto_tree_add_text(tree, tvb, offset, 2, "usertype: %d", tvb_get_letohs(tvb, offset));

Would this be easier to read if "Column %d" had the other items under it in a subtree, with the "Column %d" item having a length equal to the length of the data for that column, and perhaps having a summary of the column data appended to "Column N"?

@@ -1055,7 +1081,7 @@
 		offset += 1;
 		if(msg_len != 0) {
 			msg = tvb_fake_unicode(tvb, offset, msg_len, TRUE);
- proto_tree_add_text(tree, tvb, offset, msg_len*2, "Text: %s", format_text(msg, strlen(msg)));
+			proto_tree_add_text(tree, tvb, offset, msg_len*2, "Text: %s", msg);
 			g_free(msg);
 			offset += msg_len*2;
 		}

Why get rid of the "format_text()" call?