diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2008-09-08 13:06:44 +0000 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2008-09-08 13:06:44 +0000 |
| commit | eb652b570e765bcf12120fd831bf42b3e7f19652 (patch) | |
| tree | 22922bda5cae6325d69f003f33f620efc8f0b6e4 /src/FtpConnection.h | |
| parent | dbc8f5b737607db38399385e3b94f8dec9b3576c (diff) | |
2008-09-08 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Implemented the ability to get timestamp from remote FTP server
using
MDTM command described in RFC3659.
* src/FtpConnection.cc
* src/FtpConnection.h
* src/FtpNegotiationCommand.cc
* src/FtpNegotiationCommand.h
* test/FtpConnectionTest.cc
* test/Makefile.am
Diffstat (limited to 'src/FtpConnection.h')
| -rw-r--r-- | src/FtpConnection.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/FtpConnection.h b/src/FtpConnection.h index 51fe4039..80a0a195 100644 --- a/src/FtpConnection.h +++ b/src/FtpConnection.h @@ -37,6 +37,7 @@ #include "common.h" #include "SharedHandle.h" +#include "TimeA2.h" #include <utility> #include <string> @@ -74,6 +75,7 @@ public: void sendPass() const; void sendType() const; void sendCwd() const; + void sendMdtm() const; void sendSize() const; void sendPasv() const; SharedHandle<SocketCore> sendPort() const; @@ -82,6 +84,13 @@ public: unsigned int receiveResponse(); unsigned int receiveSizeResponse(uint64_t& size); + // Returns status code of MDTM reply. If the status code is 213, parses + // time-val and store it in time. + // If a code other than 213 is returned, time is not touched. + // Expect MDTM reply is YYYYMMDDhhmmss in GMT. If status is 213 but returned + // date cannot be parsed, then executes time.setTimeInSec(-1). + // If reply is not received yet, returns 0. + unsigned int receiveMdtmResponse(Time& time); unsigned int receivePasvResponse(std::pair<std::string, uint16_t>& dest); }; |
