MCPcopy Create free account
hub / github.com/apache/httpd / subst_str

Function subst_str

modules/http2/h2_proxy_util.c:928–948  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

926}
927
928static size_t subst_str(link_ctx *ctx, int start, int end, const char *ns)
929{
930 int olen, nlen, plen;
931 int delta;
932 char *p;
933
934 olen = end - start;
935 nlen = (int)strlen(ns);
936 delta = nlen - olen;
937 plen = ctx->slen + delta + 1;
938 p = apr_palloc(ctx->pool, plen);
939 memcpy(p, ctx->s, start);
940 memcpy(p + start, ns, nlen);
941 strcpy(p + start + nlen, ctx->s + end);
942 ctx->s = p;
943 ctx->slen = plen - 1; /* (int)strlen(p) */
944 if (ctx->i >= end) {
945 ctx->i += delta;
946 }
947 return nlen;
948}
949
950static void map_link(link_ctx *ctx)
951{

Callers 1

map_linkFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected