Arduino WiFi Sheild - Aduino lockup

The problem may be the connection state. If the connection is broken, that code will not close the connection. That normally causes problems for a server if the firmware is working ok. It is up to the server to close the connection.

In other words, there is no client.stop() call in that code.