Removed trailing whitespaces from .h and .c files using the
[obnox/wireshark/wip.git] / packet-http.c
index 41529da12be5bf8e5b9a0a3958295a14a509fd7f..304c824b79164a607c22aa4ac6fcf33b2bdefd82 100644 (file)
@@ -6,7 +6,7 @@
  * Copyright 2002, Tim Potter <tpot@samba.org>
  * Copyright 1999, Andrew Tridgell <tridge@samba.org>
  *
- * $Id: packet-http.c,v 1.52 2002/08/13 05:38:04 tpot Exp $
+ * $Id: packet-http.c,v 1.55 2002/08/14 23:34:20 tpot Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -132,26 +132,26 @@ base64_to_tvb(char *base64)
 {
        tvbuff_t *tvb;
        char *data = g_strdup(base64);
-       ssize_t len;
+       size_t len;
 
        len = base64_decode(data);
        tvb = tvb_new_real_data(data, len, len);
 
-       /* XXX: need to set free function */
+       tvb_set_free_cb(tvb, g_free);
 
        return tvb;
 }
 
 static void
-dissect_http_ntlmssp(packet_info *pinfo, proto_tree *tree, char *line)
+dissect_http_ntlmssp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, char *line)
 {
        tvbuff_t *ntlmssp_tvb;
 
        ntlmssp_tvb = base64_to_tvb(line);
+       tvb_set_child_real_data_tvbuff(tvb, ntlmssp_tvb);
+       add_new_data_source(pinfo, ntlmssp_tvb, "NTLMSSP Data");
 
        call_dissector(ntlmssp_handle, ntlmssp_tvb, pinfo, tree);
-
-       tvb_free(ntlmssp_tvb);
 }
 
 static void
@@ -312,14 +312,14 @@ dissect_http(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
                                hdr_tree = proto_item_add_subtree(
                                        hdr_item, ett_http_ntlmssp);
                                text += strlen(NTLMSSP_AUTH);
-                               dissect_http_ntlmssp(pinfo, hdr_tree, text);
+                               dissect_http_ntlmssp(tvb, pinfo, hdr_tree, text);
                        }
 
                        if (strncmp(text, NTLMSSP_WWWAUTH, strlen(NTLMSSP_WWWAUTH)) == 0) {
                                hdr_tree = proto_item_add_subtree(
                                        hdr_item, ett_http_ntlmssp);
                                text += strlen(NTLMSSP_WWWAUTH);
-                               dissect_http_ntlmssp(pinfo, hdr_tree, text);
+                               dissect_http_ntlmssp(tvb, pinfo, hdr_tree, text);
                        }
                }
                offset = next_offset;