diff options
author | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2003-09-02 23:09:11 +0000 |
---|---|---|
committer | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2003-09-02 23:09:11 +0000 |
commit | 2bc584500c412f314d909e7f45343cca590eb7d4 (patch) | |
tree | b38556181489421510029e6465d46e7b8a393b59 /tap-httpstat.c | |
parent | fac8d77d0a001c7f5628ab142819d4b5c7539f10 (diff) |
The code in an HTTP reply is a response code, not a response method.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@8346 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'tap-httpstat.c')
-rw-r--r-- | tap-httpstat.c | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/tap-httpstat.c b/tap-httpstat.c index e03101c590..f4a024cec4 100644 --- a/tap-httpstat.c +++ b/tap-httpstat.c @@ -1,7 +1,7 @@ /* tap-httpstat.c * tap-httpstat 2003 Jean-Michel FAYARD * - * $Id: tap-httpstat.c,v 1.1 2003/09/02 22:47:58 guy Exp $ + * $Id: tap-httpstat.c,v 1.2 2003/09/02 23:09:10 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -46,12 +46,13 @@ typedef struct _http_stats_t { /* used to keep track of the stats for a specific response code * for example it can be { 3, 404, "Not Found" ,...} * which means we captured 3 reply http/1.1 404 Not Found */ -typedef struct _http_response_methode_t { +typedef struct _http_response_code_t { guint32 packets; /* 3 */ - guint response_method; /* 404 */ + guint response_code; /* 404 */ gchar *name; /* Not Found */ httpstat_t *sp; -} http_response_methode_t; +} http_response_code_t; + /* used to keep track of the stats for a specific request string */ typedef struct _http_request_methode_t { gchar *response; /* eg. : GET */ @@ -122,10 +123,10 @@ http_init_hash( httpstat_t *sp) for (i=0 ; vals_status_code[i].strptr ; i++ ) { gint *key = g_malloc (sizeof(gint)); - http_response_methode_t *sc = g_malloc (sizeof(http_response_methode_t)); + http_response_code_t *sc = g_malloc (sizeof(http_response_code_t)); *key = vals_status_code[i].value; sc->packets=0; - sc->response_method = *key; + sc->response_code = *key; sc->name=vals_status_code[i].strptr; sc->sp = sp; g_hash_table_insert( sc->sp->hash_responses, key, sc); @@ -141,7 +142,7 @@ http_draw_hash_requests( gchar *key _U_ , http_request_methode_t *data, gchar * } static void -http_draw_hash_responses( gint * key _U_ , http_response_methode_t *data, char * format) +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); @@ -150,7 +151,7 @@ http_draw_hash_responses( gint * key _U_ , http_response_methode_t *data, char * if (data->packets==0) return; /* " HTTP %3d %-35s %9d packets", */ - printf(format, data->response_method, data->name, data->packets ); + printf(format, data->response_code, data->name, data->packets ); } @@ -165,7 +166,7 @@ http_free_hash( gpointer key, gpointer value, gpointer user_data _U_ ) } */ static void -http_reset_hash_responses(gchar *key _U_ , http_response_methode_t *data, gpointer ptr _U_ ) +http_reset_hash_responses(gchar *key _U_ , http_response_code_t *data, gpointer ptr _U_ ) { data->packets = 0; } @@ -193,11 +194,11 @@ httpstat_packet(void *psp , packet_info *pinfo _U_, epan_dissect_t *edt _U_, voi /* We are only interested in reply packets with a status code */ /* Request or reply packets ? */ - if (value->response_method!=0) { + if (value->response_code!=0) { guint *key=g_malloc( sizeof(guint) ); - http_response_methode_t *sc; + http_response_code_t *sc; - *key=value->response_method ; + *key=value->response_code ; sc = g_hash_table_lookup( sp->hash_responses, key); @@ -205,7 +206,7 @@ httpstat_packet(void *psp , packet_info *pinfo _U_, epan_dissect_t *edt _U_, voi /* non standard status code ; we classify it as others * in the relevant category (Informational,Success,Redirection,Client Error,Server Error) */ - int i = value->response_method; + int i = value->response_code; if ((i<100) || (i>=600)) { return 0; } |