Skip to content
Snippets Groups Projects
Commit 221f3006 authored by Guillaume Roguez's avatar Guillaume Roguez
Browse files

data tx: fix GO msg

GO message was send at every "incoming-read" loop.
Only one msg is needed.

Change-Id: I11a808eced6c08a9e76e9615d2218c43710f7546
parent c14b731d
Branches
No related tags found
No related merge requests found
......@@ -70,6 +70,8 @@ FtpServer::startNewFile()
if (!out_) {
RING_DBG() << "[FTP] transfer aborted by client";
closed_ = true; // send NOK msg at next read()
} else {
go_ = true;
}
return bool(out_);
}
......@@ -96,11 +98,12 @@ FtpServer::read(std::vector<uint8_t>& buffer) const
} else {
buffer.resize(0);
}
return true;
} else if (go_) {
go_ = false;
buffer.resize(3);
buffer[0] = 'G'; buffer[1] = 'O'; buffer[2] = '\n';
RING_DBG() << "[FTP] sending GO order";
}
buffer.resize(3);
buffer[0] = 'G'; buffer[1] = 'O'; buffer[2] = '\n';
RING_DBG() << "[FTP] sending GO order";
return true;
}
......
......@@ -60,6 +60,7 @@ private:
std::string displayName_;
std::array<char, 1000> line_;
mutable bool closed_ {false};
mutable bool go_ {false};
FtpState state_ {FtpState::PARSE_HEADERS};
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment