httpd_uri: httpd_register_uri_handler: no slots left for registering handler

zliudr
Posts: 357
Joined: Thu Oct 03, 2019 5:15 am

httpd_uri: httpd_register_uri_handler: no slots left for registering handler

Postby zliudr » Wed Oct 09, 2019 3:09 pm

Hi, I kept getting "httpd_uri: httpd_register_uri_handler: no slots left for registering handler" even for the first handler I thought I registered. There must be some registration I didn't know about.

Is there any way to find out what's been registered by calling a function?

Can someone point to the library code that handles this so I can add or turn on debug info?

Thanks.

Calebe94
Posts: 2
Joined: Mon Apr 06, 2020 3:07 pm

Re: httpd_uri: httpd_register_uri_handler: no slots left for registering handler

Postby Calebe94 » Mon Apr 06, 2020 3:12 pm

Hello friend.

Did you found any solution to this problem? I'm having the same problem in my project, if I find some solution I'll share with you guys!

zliudr
Posts: 357
Joined: Thu Oct 03, 2019 5:15 am

Re: httpd_uri: httpd_register_uri_handler: no slots left for registering handler

Postby zliudr » Tue Apr 07, 2020 3:37 am

I'm sorry. I think my project changed direction and I didn't continue on the httpd route. I looked up what I wrote down and nothing.

Calebe94
Posts: 2
Joined: Mon Apr 06, 2020 3:07 pm

Re: httpd_uri: httpd_register_uri_handler: no slots left for registering handler

Postby Calebe94 » Tue Apr 07, 2020 5:51 pm

Hello my friend,

I've just solved the problem by specifying the max_uri_handlers on my init_webservice function.

The solution can be seeing below:

Code: Select all

esp_err_t init_webservice(char * base_path, httpd_handle_t * auxserver, rest_server_context_t * auxrest_context)
{
	...
	
	httpd_handle_t server = NULL;
    	httpd_config_t config = HTTPD_DEFAULT_CONFIG();
    	config.max_uri_handlers = 10;
    	config.uri_match_fn = httpd_uri_match_wildcard;
    	...
    	
    	init_routes(server, rest_context);
}
My current project is using 10 routes right now, so I passad this number to config.max_uri_handlers element and thats it.

I hope someone finds this solution useful.

lisa999
Posts: 1
Joined: Sat Sep 12, 2020 6:54 pm

Re: httpd_uri: httpd_register_uri_handler: no slots left for registering handler

Postby lisa999 » Sat Sep 12, 2020 6:56 pm

Calebe94 wrote:
Tue Apr 07, 2020 5:51 pm
Hello my friend,

I've just solved the problem by specifying the max_uri_handlers on my init_webservice function.

The solution can be seeing below:

Code: Select all

esp_err_t init_webservice(char * base_path, httpd_handle_t * auxserver, rest_server_context_t * auxrest_context)
{
	...
	
	httpd_handle_t server = NULL;
    	httpd_config_t config = HTTPD_DEFAULT_CONFIG();
    	config.max_uri_handlers = 10;
    	config.uri_match_fn = httpd_uri_match_wildcard;
    	...
    	
    	init_routes(server, rest_context);
}
My current project is using 10 routes right now, so I passad this number to config.max_uri_handlers element and thats it.

I hope someone finds this solution useful.
Thx!

sergiomarina
Posts: 46
Joined: Wed Feb 05, 2020 6:29 pm

Re: httpd_uri: httpd_register_uri_handler: no slots left for registering handler

Postby sergiomarina » Sat May 21, 2022 11:09 pm

Very good!! :) :)

Who is online

Users browsing this forum: No registered users and 139 guests