Lines Matching refs:off

389 static const buffer * http_header_remap_host_match (buffer *b, size_t off, http_header_remap_opts *…  in http_header_remap_host_match()  argument
395 const char * const s = b->ptr+off; in http_header_remap_host_match()
430 static size_t http_header_remap_host (buffer *b, size_t off, http_header_remap_opts *remap_hdrs, in… in http_header_remap_host() argument
433 http_header_remap_host_match(b, off, remap_hdrs, is_req, alen); in http_header_remap_host()
436 buffer_substr_replace(b, off, alen, m); in http_header_remap_host()
442 static size_t http_header_remap_urlpath (buffer *b, size_t off, http_header_remap_opts *remap_hdrs,… in http_header_remap_urlpath() argument
446 const char * const s = b->ptr+off; in http_header_remap_urlpath()
447 const size_t plen = buffer_clen(b) - off; /*(urlpath len)*/ in http_header_remap_urlpath()
455 buffer_substr_replace(b, off, mlen, &ds->value); in http_header_remap_urlpath()
465 buffer_substr_replace(b, off, mlen, &ds->key); in http_header_remap_urlpath()
473 buffer_substr_replace(b, off, mlen, &ds->key); in http_header_remap_urlpath()
484 static void http_header_remap_uri (buffer *b, size_t off, http_header_remap_opts *remap_hdrs, int i… in http_header_remap_uri() argument
488 if (b->ptr[off] != '/') { in http_header_remap_uri()
489 char *s = b->ptr+off; in http_header_remap_uri()
496 slen = s - (b->ptr+off); in http_header_remap_uri()
498 off = (size_t)(s - b->ptr); in http_header_remap_uri()
500 alen = (size_t)(s - b->ptr) - off; in http_header_remap_uri()
504 alen = buffer_clen(b) - off; in http_header_remap_uri()
510 m = http_header_remap_host_match(b, off, remap_hdrs, is_req, alen); in http_header_remap_uri()
513 && (is_req ? 5==slen && 0==memcmp(b->ptr+off-slen-3,"https",5) in http_header_remap_uri()
514 : 4==slen && 0==memcmp(b->ptr+off-slen-3,"http",4))){ in http_header_remap_uri()
516 memcpy(b->ptr+off-slen-3+4,"://",3); /*("https"=>"http")*/ in http_header_remap_uri()
517 --off; in http_header_remap_uri()
521 memcpy(b->ptr+off-slen-3+4,"s://",4); /*("http" =>"https")*/ in http_header_remap_uri()
522 ++off; in http_header_remap_uri()
526 buffer_substr_replace(b, off, alen, m); in http_header_remap_uri()
529 off += alen; in http_header_remap_uri()
533 http_header_remap_urlpath(b, off, remap_hdrs, is_req); in http_header_remap_uri()
538 static void http_header_remap_setcookie (buffer *b, size_t off, http_header_remap_opts *remap_hdrs) in http_header_remap_setcookie() argument
545 for (char *s = b->ptr+off, *e; *s; s = e) { in http_header_remap_setcookie()
567 off = (size_t)(e - b->ptr); in http_header_remap_setcookie()
568 len = http_header_remap_urlpath(b, off, remap_hdrs, 0); in http_header_remap_setcookie()
569 e = b->ptr+off+len; /*(b may have been reallocated)*/ in http_header_remap_setcookie()
579 off = (size_t)(e - b->ptr); in http_header_remap_setcookie()
582 len = http_header_remap_host(b, off, remap_hdrs, 0, alen); in http_header_remap_setcookie()
583 e = b->ptr+off+len; /*(b may have been reallocated)*/ in http_header_remap_setcookie()