[libsoup] sniffer: do not copy the buffer passed to the sniffer



commit 27ec68b66ce5719b924d6d6a71adcda7998841d4
Author: Carlos Garcia Campos <cgarcia igalia com>
Date:   Fri May 14 10:09:41 2021 +0200

    sniffer: do not copy the buffer passed to the sniffer

 libsoup/content-sniffer/soup-content-sniffer-stream.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/libsoup/content-sniffer/soup-content-sniffer-stream.c 
b/libsoup/content-sniffer/soup-content-sniffer-stream.c
index 2cd054c9..b3e107e9 100644
--- a/libsoup/content-sniffer/soup-content-sniffer-stream.c
+++ b/libsoup/content-sniffer/soup-content-sniffer-stream.c
@@ -144,7 +144,7 @@ read_and_sniff (GInputStream *stream, gboolean blocking,
        }
 
        /* Sniff, then return the data */
-       buf = g_bytes_new (priv->buffer, priv->buffer_nread);
+       buf = g_bytes_new_static (priv->buffer, priv->buffer_nread);
        priv->sniffed_type =
                soup_content_sniffer_sniff (priv->sniffer, priv->msg, buf,
                                            &priv->sniffed_params);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]