| 1575 | } |
| 1576 | |
| 1577 | void FtpServer::closeTransfer() |
| 1578 | { |
| 1579 | uint32_t deltaT = (int32_t)(millis() - millisBeginTrans); |
| 1580 | if(deltaT > 0 && bytesTransfered > 0) { |
| 1581 | DEBUG_PRINT(F(" Transfer completed in ")); |
| 1582 | DEBUG_PRINT(deltaT); |
| 1583 | DEBUG_PRINTLN(F(" ms, ")); |
| 1584 | DEBUG_PRINT(bytesTransfered / deltaT); |
| 1585 | DEBUG_PRINTLN(F(" kbytes/s")); |
| 1586 | |
| 1587 | if(FtpServer::_transferCallback) { |
| 1588 | FtpServer::_transferCallback(FTP_TRANSFER_STOP, getFileName(&file), bytesTransfered); |
| 1589 | } |
| 1590 | |
| 1591 | client.println(F("226-File successfully transferred")); |
| 1592 | client.print(F("226 ")); |
| 1593 | client.print(deltaT); |
| 1594 | client.print(F(" ms, ")); |
| 1595 | client.print(bytesTransfered / deltaT); |
| 1596 | client.println(F(" kbytes/s")); |
| 1597 | } else |
| 1598 | client.println(F("226 File successfully transferred")); |
| 1599 | |
| 1600 | file.close(); |
| 1601 | data.stop(); |
| 1602 | } |
| 1603 | |
| 1604 | void FtpServer::abortTransfer() |
| 1605 | { |