Lines Matching refs:uri

32 bool httpd_uri_match_wildcard(const char *template, const char *uri, size_t len)  in httpd_uri_match_wildcard()  argument
72 return (strncmp(template, uri, exact_match_chars) == 0); in httpd_uri_match_wildcard()
75 if (len > exact_match_chars && template[exact_match_chars] != uri[exact_match_chars]) { in httpd_uri_match_wildcard()
79 if (strncmp(template, uri, exact_match_chars) != 0) { in httpd_uri_match_wildcard()
94 const char *uri, size_t uri_len, in httpd_find_uri_handler() argument
106 ESP_LOGD(TAG, LOG_FMT("[%d] = %s"), i, hd->hd_calls[i]->uri); in httpd_find_uri_handler()
111 hd->config.uri_match_fn(hd->hd_calls[i]->uri, uri, uri_len) : in httpd_find_uri_handler()
112 httpd_uri_match_simple(hd->hd_calls[i]->uri, uri, uri_len)) { in httpd_find_uri_handler()
147 if (httpd_find_uri_handler(handle, uri_handler->uri, in httpd_register_uri_handler()
148 strlen(uri_handler->uri), in httpd_register_uri_handler()
151 uri_handler->uri, uri_handler->method); in httpd_register_uri_handler()
164 hd->hd_calls[i]->uri = strdup(uri_handler->uri); in httpd_register_uri_handler()
165 if (hd->hd_calls[i]->uri == NULL) { in httpd_register_uri_handler()
184 ESP_LOGD(TAG, LOG_FMT("[%d] installed %s"), i, uri_handler->uri); in httpd_register_uri_handler()
187 ESP_LOGD(TAG, LOG_FMT("[%d] exists %s"), i, hd->hd_calls[i]->uri); in httpd_register_uri_handler()
194 const char *uri, httpd_method_t method) in httpd_unregister_uri_handler() argument
196 if (handle == NULL || uri == NULL) { in httpd_unregister_uri_handler()
206 (strcmp(hd->hd_calls[i]->uri, uri) == 0)) { // Then match URI string in httpd_unregister_uri_handler()
207 ESP_LOGD(TAG, LOG_FMT("[%d] removing %s"), i, hd->hd_calls[i]->uri); in httpd_unregister_uri_handler()
209 free((char*)hd->hd_calls[i]->uri); in httpd_unregister_uri_handler()
226 ESP_LOGW(TAG, LOG_FMT("handler %s with method %d not found"), uri, method); in httpd_unregister_uri_handler()
230 esp_err_t httpd_unregister_uri(httpd_handle_t handle, const char *uri) in httpd_unregister_uri() argument
232 if (handle == NULL || uri == NULL) { in httpd_unregister_uri()
244 if (strcmp(hd->hd_calls[i]->uri, uri) == 0) { // Match URI strings in httpd_unregister_uri()
245 ESP_LOGD(TAG, LOG_FMT("[%d] removing %s"), i, uri); in httpd_unregister_uri()
247 free((char*)hd->hd_calls[i]->uri); in httpd_unregister_uri()
265 ESP_LOGW(TAG, LOG_FMT("no handler found for URI %s"), uri); in httpd_unregister_uri()
276 ESP_LOGD(TAG, LOG_FMT("[%d] removing %s"), i, hd->hd_calls[i]->uri); in httpd_unregister_all_uri_handlers()
278 free((char*)hd->hd_calls[i]->uri); in httpd_unregister_all_uri_handlers()
286 httpd_uri_t *uri = NULL; in httpd_uri() local
293 ESP_LOGD(TAG, LOG_FMT("request for %s with type %d"), req->uri, req->method); in httpd_uri()
297 uri = httpd_find_uri_handler(hd, req->uri + res->field_data[UF_PATH].off, in httpd_uri()
302 if (uri == NULL) { in httpd_uri()
305 ESP_LOGW(TAG, LOG_FMT("URI '%s' not found"), req->uri); in httpd_uri()
309 req->method, req->uri); in httpd_uri()
317 req->user_ctx = uri->user_ctx; in httpd_uri()
322 if (uri->is_websocket && aux->ws_handshake_detect && uri->method == HTTP_GET) { in httpd_uri()
324 esp_err_t ret = httpd_ws_respond_server_handshake(&hd->hd_req, uri->supported_subprotocol); in httpd_uri()
330 aux->sd->ws_handler = uri->handler; in httpd_uri()
331 aux->sd->ws_control_frames = uri->handle_ws_control_frames; in httpd_uri()
339 if (uri->handler(req) != ESP_OK) { in httpd_uri()