From Ted Percival:
[obnox/wireshark/wip.git] / tap-httpstat.c
index 6d4db1306376273d73cc79acb18daf29f19efc24..352485d2055ae95de9f29b6539b405f7f63d51e4 100644 (file)
@@ -32,6 +32,7 @@
 #include "epan/packet_info.h"
 #include "epan/value_string.h"
 #include <epan/tap.h>
+#include <epan/stat_cmd_args.h>
 #include "register.h"
 #include <epan/dissectors/packet-http.h>
 
@@ -145,7 +146,7 @@ static void
 http_draw_hash_responses( gint * key _U_ , http_response_code_t *data, char * format)
 {
        if (data==NULL) {
-               g_warning("C'est quoi ce borderl key=%d\n", *key);
+               g_warning("No data available, key=%d\n", *key);
                exit(EXIT_FAILURE);
        }
        if (data->packets==0)
@@ -180,10 +181,10 @@ static void
 httpstat_reset(void *psp  )
 {
        httpstat_t *sp=psp;
-       if (!sp) {
-               g_hash_table_foreach( sp->hash_responses, (GHFunc)http_reset_hash_responses, NULL);
-               g_hash_table_foreach( sp->hash_responses, (GHFunc)http_reset_hash_requests, NULL);
-       }
+
+       g_hash_table_foreach( sp->hash_responses, (GHFunc)http_reset_hash_responses, NULL);
+       g_hash_table_foreach( sp->hash_requests, (GHFunc)http_reset_hash_requests, NULL);
+
 }
 
 static int
@@ -280,7 +281,7 @@ httpstat_draw(void *psp  )
 /* When called, this function will create a new instance of gtk_httpstat.
  */
 static void
-gtk_httpstat_init(const char *optarg)
+gtk_httpstat_init(const char *optarg,void* userdata _U_)
 {
        httpstat_t *sp;
        const char *filter=NULL;
@@ -325,5 +326,5 @@ gtk_httpstat_init(const char *optarg)
 void
 register_tap_listener_gtkhttpstat(void)
 {
-       register_tap_listener_cmd_arg("http,stat,", gtk_httpstat_init);
+       register_stat_cmd_arg("http,stat,", gtk_httpstat_init,NULL);
 }