Get rid of a Clist and move the functon to display floats with two decimals to gui_utils.
[metze/wireshark/wip.git] / tap-httpstat.c
index e957588b0d06068fec460755de4e5ac922ed4318..7a611a95872c3b661404a0f6bea3f72e0632e262 100644 (file)
@@ -3,8 +3,8 @@
  *
  * $Id$
  *
- * Ethereal - Network traffic analyzer
- * By Gerald Combs <gerald@ethereal.com>
+ * Wireshark - Network traffic analyzer
+ * By Gerald Combs <gerald@wireshark.org>
  * Copyright 1998 Gerald Combs
  * 
  * This program is free software; you can redistribute it and/or
@@ -146,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)
@@ -181,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
@@ -281,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;
@@ -295,8 +295,7 @@ gtk_httpstat_init(const char *optarg)
        
        sp = g_malloc( sizeof(httpstat_t) );
        if(filter){
-               sp->filter=g_malloc(strlen(filter)+1);
-               strcpy(sp->filter,filter);
+               sp->filter=g_strdup(filter);
        } else {
                sp->filter=NULL;
        }
@@ -314,7 +313,7 @@ gtk_httpstat_init(const char *optarg)
                /* error, we failed to attach to the tap. clean up */
                g_free(sp->filter);
                g_free(sp);
-               fprintf (stderr, "tethereal: Couldn't register http,stat tap: %s\n",
+               fprintf (stderr, "tshark: Couldn't register http,stat tap: %s\n",
                                error_string->str);
                g_string_free(error_string, TRUE);
                exit(1);
@@ -326,5 +325,5 @@ gtk_httpstat_init(const char *optarg)
 void
 register_tap_listener_gtkhttpstat(void)
 {
-       register_stat_cmd_arg("http,stat,", gtk_httpstat_init);
+       register_stat_cmd_arg("http,stat,", gtk_httpstat_init,NULL);
 }