mirror of
https://github.com/ksherlock/marignotti.git
synced 2024-12-11 17:51:04 +00:00
pass in Entry instead of ipid.
This commit is contained in:
parent
12c3d22853
commit
94c54160d8
16
mread.c
16
mread.c
@ -8,11 +8,10 @@
|
||||
#pragma optimize 79
|
||||
|
||||
// called through GSOS.
|
||||
int mread(int ipid, void *p1, void *p2, void *p3, void *p4, void *p5)
|
||||
int mread(Entry *e, void *p1, void *p2, void *p3, void *p4, void *p5)
|
||||
{
|
||||
rrBuff rr;
|
||||
|
||||
Entry *e;
|
||||
int xerrno = 0;
|
||||
LongWord count;
|
||||
LongWord timeout;
|
||||
@ -24,19 +23,12 @@ int mread(int ipid, void *p1, void *p2, void *p3, void *p4, void *p5)
|
||||
*(LongWord *)p2 = 0;
|
||||
|
||||
|
||||
e = find_entry(ipid);
|
||||
|
||||
if (!e)
|
||||
{
|
||||
return EBADF;
|
||||
}
|
||||
|
||||
count = e->_RCVLOWAT;
|
||||
if (count > nbytes) count = nbytes;
|
||||
|
||||
// call immediately if possible, otherwise queue it up.
|
||||
IncBusy();
|
||||
terr = TCPIPStatusTCP(ipid, &e->sr);
|
||||
terr = TCPIPStatusTCP(e->ipid, &e->sr);
|
||||
t = _toolErr;
|
||||
DecBusy();
|
||||
if (t) terr = t;
|
||||
@ -56,7 +48,7 @@ int mread(int ipid, void *p1, void *p2, void *p3, void *p4, void *p5)
|
||||
if (count)
|
||||
{
|
||||
IncBusy();
|
||||
terr = TCPIPReadTCP(ipid, 0, (Ref)buffer, count, &rr);
|
||||
terr = TCPIPReadTCP(e->ipid, 0, (Ref)buffer, count, &rr);
|
||||
t = _toolErr;
|
||||
DecBusy();
|
||||
if (t) terr = t;
|
||||
@ -103,7 +95,7 @@ int mread(int ipid, void *p1, void *p2, void *p3, void *p4, void *p5)
|
||||
if (count)
|
||||
{
|
||||
IncBusy();
|
||||
terr = TCPIPReadTCP(ipid, 0, (Ref)buffer, count, &rr);
|
||||
terr = TCPIPReadTCP(e->ipid, 0, (Ref)buffer, count, &rr);
|
||||
t = _toolErr;
|
||||
DecBusy();
|
||||
|
||||
|
12
mwrite.c
12
mwrite.c
@ -8,9 +8,8 @@
|
||||
#pragma optimize 79
|
||||
|
||||
// called through GSOS.
|
||||
int mwrite(int ipid, void *p1, void *p2, void *p3, void *p4, void *p5)
|
||||
int mwrite(Entry *e, void *p1, void *p2, void *p3, void *p4, void *p5)
|
||||
{
|
||||
Entry *e;
|
||||
Word terr;
|
||||
Word t;
|
||||
int xerrno;
|
||||
@ -20,21 +19,14 @@ int mwrite(int ipid, void *p1, void *p2, void *p3, void *p4, void *p5)
|
||||
|
||||
*(LongWord *)p2 = 0;
|
||||
|
||||
e = find_entry(ipid);
|
||||
|
||||
if (!e)
|
||||
{
|
||||
return EBADF;
|
||||
}
|
||||
|
||||
// todo -- queue up if pending >= _SNDLOWAT?
|
||||
// todo -- push?
|
||||
|
||||
IncBusy();
|
||||
terr = TCPIPWriteTCP(ipid, buffer, nbytes, 0, 0);
|
||||
terr = TCPIPWriteTCP(e->ipid, buffer, nbytes, 0, 0);
|
||||
t = _toolErr;
|
||||
DecBusy();
|
||||
|
||||
if (t) terr = t;
|
||||
|
||||
if (t || terr == tcperrBadConnection)
|
||||
|
Loading…
Reference in New Issue
Block a user