sq epan/dissectors/packet-iwarp-mpa.c tcp_dissect_pdus
[metze/wireshark/wip.git] / frame_tvbuff.c
index 0707b46ac5d41303397e443d38af856f6b438e76..705cd47459878e8f4d09f8633db788302c4a896f 100644 (file)
@@ -62,7 +62,7 @@ frame_cache(struct tvb_frame *frame_tvb)
        wtap_rec_init(&rec);
 
        if (frame_tvb->buf == NULL) {
-               if G_UNLIKELY(!buffer_cache) buffer_cache = g_ptr_array_sized_new(1024);
+               if (G_UNLIKELY(!buffer_cache)) buffer_cache = g_ptr_array_sized_new(1024);
 
                if (buffer_cache->len > 0) {
                        frame_tvb->buf = (struct Buffer *) g_ptr_array_remove_index(buffer_cache, buffer_cache->len - 1);
@@ -190,10 +190,11 @@ frame_tvbuff_new(const struct packet_provider_data *prov, const frame_data *fd,
         * tvb_new_real_data() now there's no one
         */
 
-       tvb->real_data       = buf;
-       tvb->length          = fd->cap_len;
-       tvb->reported_length = fd->pkt_len > G_MAXINT ? G_MAXINT : fd->pkt_len;
-       tvb->initialized     = TRUE;
+       tvb->real_data        = buf;
+       tvb->length           = fd->cap_len;
+       tvb->reported_length  = fd->pkt_len > G_MAXINT ? G_MAXINT : fd->pkt_len;
+       tvb->contained_length = tvb->reported_length;
+       tvb->initialized      = TRUE;
 
        /*
         * This is the top-level real tvbuff for this data source,
@@ -240,10 +241,11 @@ frame_clone(tvbuff_t *tvb, guint abs_offset, guint abs_length)
        cloned_tvb = tvb_new(&tvb_frame_ops);
 
        /* data will be read when needed */
-       cloned_tvb->real_data       = NULL;
-       cloned_tvb->length          = abs_length;
-       cloned_tvb->reported_length = abs_length; /* XXX? */
-       cloned_tvb->initialized     = TRUE;
+       cloned_tvb->real_data        = NULL;
+       cloned_tvb->length           = abs_length;
+       cloned_tvb->reported_length  = abs_length; /* XXX? */
+       cloned_tvb->contained_length = cloned_tvb->reported_length;
+       cloned_tvb->initialized      = TRUE;
 
        /*
         * This is the top-level real tvbuff for this data source,
@@ -293,10 +295,11 @@ file_tvbuff_new(const struct packet_provider_data *prov, const frame_data *fd,
         * tvb_new_real_data() now there's no one
         */
 
-       tvb->real_data       = buf;
-       tvb->length          = fd->cap_len;
-       tvb->reported_length = fd->pkt_len > G_MAXINT ? G_MAXINT : fd->pkt_len;
-       tvb->initialized     = TRUE;
+       tvb->real_data        = buf;
+       tvb->length           = fd->cap_len;
+       tvb->reported_length  = fd->pkt_len > G_MAXINT ? G_MAXINT : fd->pkt_len;
+       tvb->contained_length = tvb->reported_length;
+       tvb->initialized      = TRUE;
 
        /*
         * This is the top-level real tvbuff for this data source,