| 442 | } |
| 443 | |
| 444 | void FtpServerConnection::response(int code, String text, char sep) |
| 445 | { |
| 446 | String response = String(code, DEC); |
| 447 | response += sep; |
| 448 | if(text.length() == 0) { |
| 449 | if(code >= 200 && code <= 399) { // Just for simplify |
| 450 | response += _F("OK"); |
| 451 | } else { |
| 452 | response += _F("FAIL"); |
| 453 | } |
| 454 | } else { |
| 455 | response += text; |
| 456 | } |
| 457 | response += "\r\n"; |
| 458 | |
| 459 | debug_d("> %s", response.c_str()); |
| 460 | writeString(response); |
| 461 | flush(); |
| 462 | } |