diff options
author | Guy Harris <guy@alum.mit.edu> | 2003-09-02 23:09:11 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2003-09-02 23:09:11 +0000 |
commit | fdfd8b58af01870f3b822a6413807c7b1456961a (patch) | |
tree | b38556181489421510029e6465d46e7b8a393b59 /packet-http.c | |
parent | 75ae0e30c7ff9e539a80562a431e1cd2719e78a1 (diff) | |
download | wireshark-fdfd8b58af01870f3b822a6413807c7b1456961a.tar.gz |
The code in an HTTP reply is a response code, not a response method.
svn path=/trunk/; revision=8346
Diffstat (limited to 'packet-http.c')
-rw-r--r-- | packet-http.c | 35 |
1 files changed, 15 insertions, 20 deletions
diff --git a/packet-http.c b/packet-http.c index f326994dd6..4b5cbdf004 100644 --- a/packet-http.c +++ b/packet-http.c @@ -6,7 +6,7 @@ * Copyright 2002, Tim Potter <tpot@samba.org> * Copyright 1999, Andrew Tridgell <tridge@samba.org> * - * $Id: packet-http.c,v 1.66 2003/09/02 22:47:57 guy Exp $ + * $Id: packet-http.c,v 1.67 2003/09/02 23:09:10 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -58,7 +58,7 @@ static int hf_http_response = -1; static int hf_http_request = -1; static int hf_http_basic = -1; static int hf_http_request_method = -1; -static int hf_http_response_method = -1; +static int hf_http_response_code = -1; static gint ett_http = -1; static gint ett_http_ntlmssp = -1; @@ -219,7 +219,7 @@ dissect_http(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) proto_tree *req_tree; stat_info =g_malloc( sizeof(http_info_value_t)); - stat_info->response_method = 0; + stat_info->response_code = 0; stat_info->request_method = NULL; switch (pinfo->match_port) { @@ -454,20 +454,20 @@ basic_request_dissector(tvbuff_t *tvb, proto_tree *tree, int req_strlen) { proto_tree_add_item(tree, hf_http_request_method, tvb, 0, req_strlen, FALSE); } + static void -response_method_request_dissector(tvbuff_t *tvb, proto_tree *tree, int req_strlen _U_ ) +basic_response_dissector(tvbuff_t *tvb, proto_tree *tree, int req_strlen _U_) { const guchar *data; int minor, major, status_code; - data = tvb_get_ptr(tvb, 0, 12); - if (sscanf(data, "HTTP/%d.%d %d", &minor, &major, &status_code)==3) - { - proto_tree_add_uint(tree, hf_http_response_method, tvb, 9, 3, status_code); - stat_info->response_method = status_code; + + data = tvb_get_ptr(tvb, 5, 12); + if (sscanf(data, "%d.%d %d", &minor, &major, &status_code) == 3) { + proto_tree_add_uint(tree, hf_http_response_code, tvb, 9, 3, status_code); + stat_info->response_code = status_code; } } - /* * XXX - this won't handle HTTP 0.9 replies, but they're all data * anyway. @@ -499,16 +499,11 @@ is_http_request_or_reply(const guchar *data, int linelen, http_type_t *type, * SEARCH */ if (linelen >= 5 && strncmp(data, "HTTP/", 5) == 0) { - *type = HTTP_RESPONSE; isHttpRequestOrReply = TRUE; /* response */ - if (req_dissector && (linelen >= 12) ) - { - *req_dissector = response_method_request_dissector ; - *req_strlen = 3; - } else if (req_dissector) { - *req_dissector = NULL; /* no dissector for this yet. */ + *req_dissector = basic_response_dissector; + *req_strlen = linelen - 5; } } else { const guchar * ptr = (const guchar *)data; @@ -653,10 +648,10 @@ proto_register_http(void) { "Request Method", "http.request.method", FT_STRING, BASE_NONE, NULL, 0x0, "HTTP Request Method", HFILL }}, - { &hf_http_response_method, - { "Response Method", "http.response.method", + { &hf_http_response_code, + { "Response Code", "http.response.code", FT_UINT16, BASE_DEC, NULL, 0x0, - "HTTP Response Method", HFILL }}, + "HTTP Response Code", HFILL }}, }; static gint *ett[] = { &ett_http, |