summaryrefslogtreecommitdiff
path: root/ui/gtk/follow_stream.c
diff options
context:
space:
mode:
authorJeff Morriss <jeff.morriss.ws@gmail.com>2016-07-17 15:24:55 -0400
committerPeter Wu <peter@lekensteyn.nl>2016-07-18 10:43:23 +0000
commit468a5e27255190cc7cfa2e52a2b54578dcb9e1d8 (patch)
treef3084560153d3d71dc7509ec942bd4d0ea6582b5 /ui/gtk/follow_stream.c
parent752ba1abad6f549616ab65418522a067c58f0f24 (diff)
downloadwireshark-468a5e27255190cc7cfa2e52a2b54578dcb9e1d8.tar.gz
Use follow_record_t in SSL follow stream.
... rather than a structure (SslDecryptedRecord) which looks (mostly) like a follow_record_t. (The biggest different is the former carries its data in a StringInfo while the latter uses a GByteArray.) With this change following SSL no longer needs its own special code. This also fixes a crash after saving a followed SSL stream (in the Qt UI). Bug: 12616 Change-Id: Ibdb2b85f8a6a30712743a5da420be1e6b78f5b92 Reviewed-on: https://code.wireshark.org/review/16516 Petri-Dish: Jeff Morriss <jeff.morriss.ws@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Diffstat (limited to 'ui/gtk/follow_stream.c')
-rw-r--r--ui/gtk/follow_stream.c63
1 files changed, 1 insertions, 62 deletions
diff --git a/ui/gtk/follow_stream.c b/ui/gtk/follow_stream.c
index d12a6234c0..2f78694df4 100644
--- a/ui/gtk/follow_stream.c
+++ b/ui/gtk/follow_stream.c
@@ -36,7 +36,6 @@
#include <epan/tap.h>
#include <epan/print.h>
-#include <epan/dissectors/packet-ssl-utils.h>
#include <ui/alert_box.h>
#include <ui/last_open_dir.h>
@@ -1235,66 +1234,6 @@ follow_http_stream_cb(GtkWidget * w _U_, gpointer data _U_)
follow_stream_cb(follower, follow_common_read_stream, w, data);
}
-/*
- * XXX - the routine pointed to by "print_line_fcn_p" doesn't get handed lines,
- * it gets handed bufferfuls. That's fine for "follow_write_raw()"
- * and "follow_add_to_gtk_text()", but, as "follow_print_text()" calls
- * the "print_line()" routine from "print.c", and as that routine might
- * genuinely expect to be handed a line (if, for example, it's using
- * some OS or desktop environment's printing API, and that API expects
- * to be handed lines), "follow_print_text()" should probably accumulate
- * lines in a buffer and hand them "print_line()". (If there's a
- * complete line in a buffer - i.e., there's nothing of the line in
- * the previous buffer or the next buffer - it can just hand that to
- * "print_line()" after filtering out non-printables, as an
- * optimization.)
- *
- * This might or might not be the reason why C arrays display
- * correctly but get extra blank lines very other line when printed.
- */
-static frs_return_t
-follow_read_ssl_stream(follow_info_t *follow_info,
- follow_print_line_func follow_print,
- void *arg)
-{
- guint32 global_client_pos = 0, global_server_pos = 0;
- guint32 server_packet_count = 0;
- guint32 client_packet_count = 0;
- guint32 * global_pos;
- GList * cur;
- frs_return_t frs_return;
-
- for (cur = follow_info->payload; cur; cur = g_list_next(cur)) {
- SslDecryptedRecord * rec = (SslDecryptedRecord*) cur->data;
- gboolean include_rec = FALSE;
-
- if (rec->is_from_server) {
- global_pos = &global_server_pos;
- include_rec = (follow_info->show_stream == BOTH_HOSTS) ||
- (follow_info->show_stream == FROM_SERVER);
- } else {
- global_pos = &global_client_pos;
- include_rec = (follow_info->show_stream == BOTH_HOSTS) ||
- (follow_info->show_stream == FROM_CLIENT);
- }
-
- if (include_rec) {
- size_t nchars = rec->data.data_len;
- gchar *buffer = (gchar *)g_memdup(rec->data.data, (guint) nchars);
-
- frs_return = follow_show(follow_info, follow_print, buffer, nchars,
- rec->is_from_server, arg, global_pos,
- &server_packet_count, &client_packet_count);
- g_free(buffer);
- if (frs_return == FRS_PRINT_ERROR)
- return frs_return;
- }
- }
-
- return FRS_OK;
-}
-
-
/* Follow the SSL stream, if any, to which the last packet that we called
a dissection routine on belongs (this might be the most recently
selected packet, or it might be the last packet in the file). */
@@ -1303,7 +1242,7 @@ follow_ssl_stream_cb(GtkWidget * w _U_, gpointer data _U_)
{
register_follow_t* follower = get_follow_by_name("SSL");
- follow_stream_cb(follower, follow_read_ssl_stream, w, data);
+ follow_stream_cb(follower, follow_common_read_stream, w, data);
}
static void