Http request received from the client is truncated

I have done scripts from the standard web server to light a LED on and off, and it worked quite OK.
then I added a few more complexities by using an RGB LED.
I connected only one leg (Green) then 2 with Blue then the third one, and I adapted the action to show various colors on my LED.
Step after step the results were ok but as a sudden it did not work at all.
I used a sketch from this web site Arduino Ethernet Shield Web Server Tutorial

When I say it did not work is the following:
I have 3 checkboxes, each to show one of the 3 main colors, then if 2 or 3 checkboxes are checked I show another mixed color.
At the beginning my sketch worked but once when I checked 2 checkboxes, first no color was shown, but then even when I checked only one checkbox, still no color.
However I saw in the serial monitor that the Http request contained the text I was looking for but it was as if this condition was not understood properly.

Then The http request as it was displayed in the serial monitor was truncated, as if there was no space for showing it.
My guess is the problem is around some variable initialization or memory problem but I cannot really identify where that could be.

thank you for your help

webserver_et_LED_RGB.ino (8.65 KB)

Try moving "Serial.print(HTTP_req);" to the top of "if (c == '\n' && currentLineIsBlank) {", just in case the processing of the input is harming the String.

Tried it but that does not change anything.
thanks anyway

In order to try to solve it I started from the beginning and used one then 2 then 3 checkboxes, and it confirmed my thoughts.
With one and two checkboxes lighting different colors I had no problem.
However when I added a third checkbox I got (for the first time) a message saying the variables memory is becoming quite weak and I experienced this problem of Http request truncated, then nothing was working.
Now, the 1 million, no, the one dollar question is, is there a document explaining how to use more memory or reduce the size of the variables?

Here is the compilation message (in french but you should easily find the useful info).

Le croquis utilise 16 234 octets (50%) de l'espace de stockage de programmes. Le maximum est de 32 256 octets.
Les variables globales utilisent 1 581 octets (77%) de mémoire dynamique, ce qui laisse 467 octets pour les variables locales. Le maximum est de 2 048 octets.

You can save a bunch of RAM by using the F() macro in every .print() or .println() that uses a string constant:
For example, change:

        cl.println("<input type=\"checkbox\" name=\"LED Bleue\" value=\"2\" \
        onclick=\"submit();\" checked>LED Bleue");


        cl.println(F("<input type=\"checkbox\" name=\"LED Bleue\" value=\"2\" \
       onclick=\"submit();\" checked>LED Bleue"));

Note: That line might be easier to read as:

         cl.println(F("<input type=\"checkbox\" name=\"LED Bleue\" value=\"2\" "
                      "onclick=\"submit();\" checked>LED Bleue"));

This uses the fact that two adjacent string constants are merged.