Permalink
Browse files

SFtp.cc: don't send FSETSTAT when file modification time is unknown.

  • Loading branch information...
1 parent ab26df0 commit b5fd8822ad539020e68553777411f75212c4b66e @lavv17 committed Mar 4, 2014
Showing with 8 additions and 4 deletions.
  1. +1 −0 src/ChangeLog
  2. +7 −4 src/SFtp.cc
View
@@ -2,6 +2,7 @@
* CmdExec.cc, CmdExec.h, commands.cc: keep track of parent CmdExec;
add 'exit parent' subcommand; flush command buffer when exiting.
+ * SFtp.cc: don't send FSETSTAT when file modification time is unknown.
2014-02-13 Alexander V. Lukyanov <lavv17f@gmail.com>
View
@@ -262,10 +262,13 @@ int SFtp::Do()
if(s==0)
{
// no more data, set attributes and close the file.
- Request_FSETSTAT *req=new Request_FSETSTAT(handle,protocol_version);
- req->attrs.mtime=entity_date;
- req->attrs.flags|=SSH_FILEXFER_ATTR_MODIFYTIME;
- SendRequest(req,Expect::IGNORE);
+ if(entity_date!=NO_DATE)
+ {
+ Request_FSETSTAT *req=new Request_FSETSTAT(handle,protocol_version);
+ req->attrs.mtime=entity_date;
+ req->attrs.flags|=SSH_FILEXFER_ATTR_MODIFYTIME;
+ SendRequest(req,Expect::IGNORE);
+ }
CloseHandle(Expect::DEFAULT);
state=WAITING;
m=MOVED;

0 comments on commit b5fd882

Please sign in to comment.