-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Why http POST form allows only 32 postArgs elements? #3284
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
The value of 32 was chosen as a compromise between supporting forms with a lot of fields and not having to allocate large postArgs array. Possible solutions:
|
Many thanks. |
Please feel free to submit a PR with the 3rd solution :) |
Hmm, I somehow expected that comment :-) |
@drschlaumeier using a std::vector is far easier than an array that gets allocated/deallocated. For this, you would need something along these lines: replace:
with Don't init _currentArgs(0) in the constructor, don't alloc it anywhere, clear it wherever it gets deleted. Replace references to When a new RequestArgument is added, do something like this: Likely some additional changes, but the above should cover the important stuff. Be aware that there is currently a bug in Arduino.h that makes #include not compile sometimes. To make certain:
|
I wonder why
|
@yoursunny that has already been fixed, and 3rd party libs have also been fixed to comply. |
Basic Infos
My Webserver Configuration Page needs to POST a form with >32 elements. Why ESP8266WebServer::_parseForm allows only 32 postArgs elements?
Hardware
Hardware: ESP-8285
Core Version: 2.4.0 ...
Description
I'm building a WebServer around my home light control based on Sonoff Touch device. The flexible configuration page of the webserver uses a html page with form and tables filled with some postArgs elements (some input - type text, some select, some input - type checkbox). All together I have 37 postArgs elements to POST back to my WebServer. After long debugging the esp CRASH I found that the ESP8266WebServer::_parseForm allows only 32 postArgs elements. ... see below code from "Parsing.cpp"
Why only 32? Can someone change to higher value? Any other idea what I can do? Is splitting the config page into several pages the right way?
Thanks in advance
Settings in IDE
Module: Generic ESP8266 Module
Flash Size: 1MB
CPU Frequency: 80Mhz
Flash Mode: DOUT
Flash Frequency: 40Mhz
Upload Using: OTA / SERIAL
Reset Method: ck
################################################
The text was updated successfully, but these errors were encountered: