httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yann Ylavic <ylavic....@gmail.com>
Subject Re: svn commit: r1779700 - /httpd/httpd/trunk/modules/filters/mod_brotli.c
Date Sat, 21 Jan 2017 08:57:12 GMT
Hi,

On Sat, Jan 21, 2017 at 7:40 AM,  <jailletc36@apache.org> wrote:
> Author: jailletc36
> Date: Sat Jan 21 06:40:23 2017
> New Revision: 1779700
>
> URL: http://svn.apache.org/viewvc?rev=1779700&view=rev
> Log:
> Save a few bytes and a few cycles.
>
> Modified:
>     httpd/httpd/trunk/modules/filters/mod_brotli.c
>
> Modified: httpd/httpd/trunk/modules/filters/mod_brotli.c
> URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/filters/mod_brotli.c?rev=1779700&r1=1779699&r2=1779700&view=diff
> ==============================================================================
> --- httpd/httpd/trunk/modules/filters/mod_brotli.c (original)
> +++ httpd/httpd/trunk/modules/filters/mod_brotli.c Sat Jan 21 06:40:23 2017
> @@ -443,9 +443,9 @@ static apr_status_t compress_filter(ap_f
>                  apr_size_t len = strlen(etag);
>
>                  if (len > 2 && etag[len - 1] == '"') {
> -                    etag = apr_pstrndup(r->pool, etag, len - 1);
> +                    etag = apr_pstrmemdup(r->pool, etag, len - 1);
>                      etag = apr_pstrcat(r->pool, etag, "-br\"", NULL);

We could possibly save more bytes yet with something like:
                       etag = apr_psnprintf(r->pool, etag, "%.*s-br\"",
                                            (int)(len - 1), etag);

Regards,
Yann.

Mime
View raw message