Error compiling Ethernet sketch

SurferTim:
Then, you should probably send a close connection after the host. If you send an HTTP/1.1 request, the server may not close that end unless you send that.

  client.println("Host: www.myserver.com");

client.println("Connection: close");
  client.println();

wouldn't the client.stop command achieve the same result as Connection: close ?

Anyway, as soon as I commented out the section starting with :

while(client.connected() && !client.available()) delay(1);

then everything worked as expected. I just can't figure out why the erratic behaviour before that.