forked from osmocom/wireshark
Show answers a line at a time, after the request frame and time delta.
Long responses are *really* hard to read if you make them one single string item. Show it a line at a time, as we do with many other text-oriented protocols. Change-Id: Ie2e81dabeba728ed34772d7015c52b0b047904e8 Reviewed-on: https://code.wireshark.org/review/35544 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <guy@alum.mit.edu>
This commit is contained in:
parent
0442f7a2c3
commit
8d65ccfee4
|
@ -118,7 +118,10 @@ dissect_whois(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
|
|||
proto_item_set_generated(ti);
|
||||
}
|
||||
} else if (tree && whois_trans->rep_frame) {
|
||||
proto_tree_add_item(whois_tree, hf_whois_answer, tvb, 0, -1, ENC_ASCII|ENC_NA);
|
||||
/*
|
||||
* If we know the request frame, show it and the time delta between
|
||||
* the request and the response.
|
||||
*/
|
||||
if (whois_trans->req_frame) {
|
||||
nstime_t ns;
|
||||
|
||||
|
@ -132,6 +135,24 @@ dissect_whois(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
|
|||
proto_item_set_generated(ti);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Show the response as text, a line at a time.
|
||||
*/
|
||||
int offset = 0, next_offset;
|
||||
while (tvb_offset_exists(tvb, offset)) {
|
||||
/*
|
||||
* Find the end of the line.
|
||||
*/
|
||||
tvb_find_line_end(tvb, offset, -1, &next_offset, FALSE);
|
||||
|
||||
/*
|
||||
* Put this line.
|
||||
*/
|
||||
proto_tree_add_item(whois_tree, hf_whois_answer, tvb, offset,
|
||||
next_offset - offset, ENC_ASCII|ENC_NA);
|
||||
offset = next_offset;
|
||||
}
|
||||
}
|
||||
|
||||
return tvb_captured_length(tvb);
|
||||
|
|
Loading…
Reference in New Issue