Lines Matching defs:hit
943 const struct lws_http_mount *hm, *hit = NULL;
976 hit = hm;
982 return hit;
991 int fd, match = 0, pos = 0, n = 0, hit = 0;
1004 hit = 1;
1012 hit = 1;
1028 return hit;
1252 lws_http_proxy_start(struct lws *wsi, const struct lws_http_mount *hit,
1284 if (hit->origin[0] == '+')
1287 pcolon = strchr(hit->origin, ':');
1288 pslash = strchr(hit->origin, '/');
1290 lwsl_err("Proxy mount origin '%s' must have /\n", hit->origin);
1301 n = lws_ptr_diff(pcolon, hit->origin);
1308 n = (int)(pcolon - hit->origin);
1310 n = (int)(pslash - hit->origin);
1316 memcpy(ads, hit->origin, (unsigned int)n);
1321 if (hit->origin_protocol == LWSMPRO_HTTPS) {
1335 pslash + 1, uri_ptr + hit->mountpoint_len) - 1;
1459 // i.uri_replace_from = hit->origin;
1460 // i.uri_replace_to = hit->mountpoint;
1510 const struct lws_http_mount *hit, char *uri_ptr,
1517 s = uri_ptr + hit->mountpoint_len;
1534 if ((hit->mountpoint_len > 1 ||
1535 (hit->origin_protocol == LWSMPRO_REDIR_HTTP ||
1536 hit->origin_protocol == LWSMPRO_REDIR_HTTPS)) &&
1538 (hit->origin_protocol == LWSMPRO_REDIR_HTTP ||
1539 hit->origin_protocol == LWSMPRO_REDIR_HTTPS)) &&
1540 (hit->origin_protocol != LWSMPRO_CGI &&
1541 hit->origin_protocol != LWSMPRO_CALLBACK)) {
1548 lwsl_info("Doing 301 '%s' org %s\n", s, hit->origin);
1551 if (hit->origin_protocol == LWSMPRO_REDIR_HTTP ||
1552 hit->origin_protocol == LWSMPRO_REDIR_HTTPS)
1554 oprot[hit->origin_protocol & 1],
1555 hit->origin);
1601 const struct lws_http_mount *hit = NULL;
1784 hit = lws_find_mount(wsi, uri_ptr, uri_len);
1785 if (!hit) {
1788 lwsl_info("no hit\n");
1791 "no mount hit"))
1803 s = uri_ptr + hit->mountpoint_len;
1805 n = (unsigned int)lws_http_redirect_hit(pt, wsi, hit, uri_ptr, uri_len, &ha);
1813 switch (lws_check_basic_auth(wsi, hit->basic_auth_login_file,
1814 hit->auth_mask & AUTH_MODE_MASK)) {
1830 // if (hit)
1831 // lwsl_notice("%s: origin_protocol: %d\n", __func__, hit->origin_protocol);
1833 // lwsl_notice("%s: no hit\n", __func__);
1835 if (hit->origin_protocol == LWSMPRO_HTTPS ||
1836 hit->origin_protocol == LWSMPRO_HTTP) {
1837 n = (unsigned int)lws_http_proxy_start(wsi, hit, uri_ptr, 0);
1852 if (hit->origin_protocol == LWSMPRO_CALLBACK || hit->protocol) {
1854 const char *name = hit->origin;
1855 if (hit->protocol)
1856 name = hit->protocol;
1869 __func__, hit->origin, hit->auth_mask);
1873 args.max_len = hit->auth_mask & ~AUTH_MODE_MASK;
1888 if (hit->cgienv && wsi->a.protocol->callback(wsi,
1890 wsi->user_space, (void *)hit->cgienv, 0))
1896 uri_ptr + hit->mountpoint_len,
1897 (unsigned int)uri_len - hit->mountpoint_len);
1903 /* did we hit something with a cgi:// origin? */
1904 if (hit->origin_protocol == LWSMPRO_CGI) {
1911 cmd[0] = hit->origin;
1914 if (hit->cgi_timeout)
1915 n = (unsigned int)hit->cgi_timeout;
1917 n = (unsigned int)lws_cgi(wsi, cmd, hit->mountpoint_len, (int)n,
1918 hit->cgienv);
1931 s = (char *)hit->def;
1936 wsi->cache_secs = (unsigned int)hit->cache_max_age;
1937 wsi->cache_reuse = hit->cache_reusable;
1938 wsi->cache_revalidate = hit->cache_revalidate;
1939 wsi->cache_intermediaries = hit->cache_intermediaries;
1943 if (hit->origin_protocol == LWSMPRO_FILE)
1944 m = lws_http_serve(wsi, s, hit->origin, hit);
1952 if (hit->protocol) {
1955 wsi->a.vhost, hit->protocol);
1968 uri_ptr + hit->mountpoint_len,
1969 (size_t)(uri_len - hit->mountpoint_len));
2339 const struct lws_http_mount *hit = NULL;
2345 hit = lws_find_mount(wsi, uri_ptr, uri_len);
2346 if (hit) {
2347 n = lws_http_redirect_hit(pt, wsi, hit, uri_ptr,
3371 int hits = 0, hit = 0;
3381 hit = n;
3392 if (hits == 1 && s->pos == (int)strlen(s->vars[hit])) {
3393 pc = s->replace(s->data, hit);