httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Eissing <stefan.eiss...@greenbytes.de>
Subject Re: svn commit: r1729208 - in /httpd/httpd/trunk/modules: proxy/proxy_util.c ssl/ssl_engine_io.c
Date Thu, 11 Feb 2016 09:19:29 GMT

> Am 10.02.2016 um 20:09 schrieb Ruediger Pluem <rpluem@apache.org>:
> 
> 
> 
> On 02/08/2016 05:50 PM, icing@apache.org wrote:
>> [...]#ifdef HAVE_TLSEXT
>> +#ifdef HAVE_TLS_ALPN
>> +        alpn_note = apr_table_get(c->notes, "proxy-request-alpn-protos");
>> +        if (alpn_note) {
>> +            char *protos, *s, *p, *last;
>> +            apr_size_t len;
>> +            
>> +            s = protos = apr_pcalloc(c->pool, strlen(alpn_note)+1);
>> +            p = apr_pstrdup(c->pool, alpn_note);
>> +            while ((p = apr_strtok(p, ", ", &last))) {
>> +                len = last - p - (*last? 1 : 0); 
>> +                if (len > 255) {
>> +                    ap_log_cerror(APLOG_MARK, APLOG_ERR, 0, c, APLOGNO()
>> +                                  "ALPN proxy protocol identifier too long: %s",
>> +                                  p);
>> +                    ssl_log_ssl_error(SSLLOG_MARK, APLOG_ERR, server);
>> +                    return APR_EGENERAL;
>> +                }
>> +                *s++ = (unsigned char)len;
>> +                while (len--) {
>> +                    *s++ = *p++;
>> +                }
>> +                p = last;
> 
> Why not p = NULL as it should be for subsequent calls of apr_strtok?

Matter of taste. If code is more readable to everyone using NULL, that is fine with me.

Changed in r1729782.

Stefan
Mime
View raw message