     client.print("X-Printer-Version: "); client.println(sketchVersion);
     client.println();
     boolean parsingHeader = true;
+
 #ifdef DEBUG
     start = millis();
 #endif
+
     while(client.connected()) {
       debug("Still connected");
       while(client.available()) {

          downloadWaiting = true;
          digitalWrite(readyLED, HIGH);
        }
      } else {
        debug2("Failure, content length was ", content_length);
        if (content_length != length)
          debug2("but length was ", length);
        if (content_length != cache.size())
          debug2("but cache size was ", cache.size());
        systemError(); // you should probably reboot
      }
    } else {
      debug("Response code wasn't 200");
      recoverableError();
    }
  } else {

char* cacheFilename = "TMP";
unsigned long content_length = 0;
boolean statusOk = false;

void checkForDownload() {
  unsigned long length = 0;
  content_length = 0;
  statusOk = false;

#ifdef DEBUG
    unsigned long start;
#endif

  if (SD.exists(cacheFilename)) {
    if (SD.remove(cacheFilename)) {
      debug("Cleared cache");
