!1639 fix: interactive shell freeze due to sending 0x0d before handshake.

Merge pull request !1639 from liurantao/master
This commit is contained in:
openharmony_ci 2024-11-01 10:13:57 +00:00 committed by Gitee
commit efa195d1d3
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -482,6 +482,10 @@ void HdcClient::ReadStd(uv_stream_t *stream, ssize_t nread, const uv_buf_t *buf)
{
HChannel hChannel = (HChannel)stream->data;
HdcClient *thisClass = (HdcClient *)hChannel->clsChannel;
if (!hChannel->handshakeOK) {
WRITE_LOG(LOG_WARN, "ReadStd handshake not ready");
return; // if not handshake, do not send the cmd input to server.
}
char *cmd = hChannel->bufStd;
if (nread <= 0) {
WRITE_LOG(LOG_FATAL, "ReadStd error nread:%zd", nread);