I am surprised that it works at all.
In loop() you declare the char variable recv then set it equal to the variable returned by recv_request(). Sounds OK so far, but in recv_request() you declare another (local) variable also called recv. This variable is then set to whatever client.read() returns and is itself returned from the function. I don't know about the compiler but I am confused as to which version of the recv variable will be seen by the calling program.
There is another anomaly with the States() function. The recv char is passed to it but the switch/case uses integers as its case variable. '0' is not the same as 0.