Changeset 08c48d7 in mod_gnutls for src/gnutls_hooks.c


Ignore:
Timestamp:
Jan 2, 2019, 3:22:48 PM (3 years ago)
Author:
Fiona Klute <fiona.klute@…>
Branches:
asyncio, debian/master, master, proxy-ticket
Children:
4d38cbd
Parents:
c7710cf
Message:

Extract code for turning APR array of strings into gnutls_datum_t array

Having it as a separate function will allow sharing the code between
server and client (proxy) side ALPN proposal handling.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/gnutls_hooks.c

    rc7710cf r08c48d7  
    198198                  apr_array_pstrcat(ctxt->c->pool, pupgrades, ','));
    199199    gnutls_datum_t *alpn_protos =
    200         apr_palloc(ctxt->c->pool,
    201                    (pupgrades->nelts + 1) * sizeof(gnutls_datum_t));
    202     for (int i = 0; i < pupgrades->nelts; i++)
    203     {
    204         alpn_protos[i].data = (void *) APR_ARRAY_IDX(pupgrades, i, char *);
    205         alpn_protos[i].size =
    206             strnlen(APR_ARRAY_IDX(pupgrades, i, char *),
    207                     pupgrades->elt_size);
    208     }
     200        mgs_str_array_to_datum_array(pupgrades,
     201                                     ctxt->c->pool,
     202                                     pupgrades->nelts + 1);
    209203
    210204    /* Add the current (default) protocol at the end of the list */
Note: See TracChangeset for help on using the changeset viewer.