mirror of
https://github.com/wfjm/w11.git
synced 2026-01-27 20:57:31 +00:00
minor updates
- ibdr_lp11_buf.vhd: remove fifo clear on BRESET - lib/defs_kwp.mac: use 'kp.' instead of 'kw.' - lib/defs_kwl.mac: added - rw11/shell_egd.tcl: shell_aspec_parse: allow 8,9 in numeric address
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
// $Id: Rw11Unit.cpp 1049 2018-09-22 13:56:52Z mueller $
|
||||
// $Id: Rw11Unit.cpp 1134 2019-04-21 17:18:03Z mueller $
|
||||
//
|
||||
// Copyright 2013-2018 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
|
||||
// Copyright 2013-2019 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
|
||||
//
|
||||
// This program is free software; you may redistribute and/or modify it under
|
||||
// the terms of the GNU General Public License as published by the Free
|
||||
@@ -112,6 +112,7 @@ void Rw11Unit::Dump(std::ostream& os, int ind, const char* text,
|
||||
RosFill bl(ind);
|
||||
os << bl << (text?text:"--") << "Rw11Unit @ " << this << endl;
|
||||
|
||||
os << bl << " fpCntlBase: " << fpCntlBase << endl;
|
||||
os << bl << " fIndex: " << fIndex << endl;
|
||||
os << bl << " fAttachOpts: " << fAttachOpts << endl;
|
||||
fStats.Dump(os, ind+2, "fStats: ", detail-1);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// $Id: Rw11VirtTermTcp.cpp 1114 2019-02-23 18:01:55Z mueller $
|
||||
// $Id: Rw11VirtTermTcp.cpp 1134 2019-04-21 17:18:03Z mueller $
|
||||
//
|
||||
// Copyright 2013-2019 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
|
||||
//
|
||||
@@ -217,10 +217,11 @@ bool Rw11VirtTermTcp::Snd(const uint8_t* data, size_t count, RerrMsg& /*emsg*/)
|
||||
return true;
|
||||
}
|
||||
|
||||
uint8_t obuf[1024];
|
||||
const size_t c_bufsiz=1024;
|
||||
uint8_t obuf[c_bufsiz];
|
||||
while (pdata < pdataend) {
|
||||
uint8_t* pobuf = obuf;
|
||||
uint8_t* pobufend = obuf+1024;
|
||||
uint8_t* pobufend = obuf+sizeof(obuf);
|
||||
while (pdata < pdataend && pobuf < pobufend-1) {
|
||||
if (*pdata == kCode_IAC) *pobuf++ = kCode_IAC;
|
||||
*pobuf++ = *pdata++;
|
||||
@@ -279,7 +280,7 @@ int Rw11VirtTermTcp::ListenPollHandler(const pollfd& pfd)
|
||||
// bail-out and cancel handler if poll returns an error event
|
||||
if (pfd.revents & (~pfd.events)) return -1;
|
||||
|
||||
fFd = accept(fFdListen, nullptr, 0);
|
||||
fFd = ::accept(fFdListen, nullptr, 0);
|
||||
|
||||
if (fFd < 0) {
|
||||
RlogMsg lmsg(LogFile(),'E');
|
||||
@@ -314,7 +315,7 @@ int Rw11VirtTermTcp::ListenPollHandler(const pollfd& pfd)
|
||||
msg << "\r\nconnect on port " << fChannelId
|
||||
<< " for " << Unit().Name() << "\r\n\r\n";
|
||||
string str = msg.str();
|
||||
if (write(fFd, str.c_str(), str.length()) < 0) nerr += 1;
|
||||
if (::write(fFd, str.c_str(), str.length()) < 0) nerr += 1;
|
||||
}
|
||||
|
||||
// send chars buffered while attached but not connected
|
||||
@@ -325,7 +326,7 @@ int Rw11VirtTermTcp::ListenPollHandler(const pollfd& pfd)
|
||||
fSndPreConQue.pop_front();
|
||||
}
|
||||
string str = msg.str();
|
||||
if (write(fFd, str.c_str(), str.length()) < 0) nerr += 1;
|
||||
if (::write(fFd, str.c_str(), str.length()) < 0) nerr += 1;
|
||||
}
|
||||
|
||||
if (nerr) {
|
||||
@@ -362,11 +363,12 @@ int Rw11VirtTermTcp::RcvPollHandler(const pollfd& pfd)
|
||||
int irc = -1;
|
||||
|
||||
if (pfd.revents & POLLIN) {
|
||||
uint8_t ibuf[1024];
|
||||
uint8_t obuf[1024];
|
||||
const size_t c_bufsiz=1024;
|
||||
uint8_t ibuf[c_bufsiz];
|
||||
uint8_t obuf[c_bufsiz];
|
||||
uint8_t* pobuf = obuf;
|
||||
|
||||
irc = ::read(fFd, ibuf, 1024);
|
||||
irc = ::read(fFd, ibuf, sizeof(ibuf));
|
||||
|
||||
if (irc < 0 && (errno == EAGAIN || errno == EWOULDBLOCK)) return 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user