mirror of
https://github.com/ksherlock/marignotti.git
synced 2024-12-21 23:29:36 +00:00
fix select support.
This commit is contained in:
parent
6eebad7335
commit
5048a815ea
12
marignotti.h
12
marignotti.h
@ -12,6 +12,8 @@ enum {
|
||||
kCommandAbortAndLogout
|
||||
};
|
||||
|
||||
typedef void (*selwakeupfx)(int collision, int pid);
|
||||
|
||||
typedef struct Entry {
|
||||
struct Entry *next;
|
||||
|
||||
@ -25,6 +27,16 @@ typedef struct Entry {
|
||||
LongWord cookie;
|
||||
LongWord timeout;
|
||||
|
||||
Word socket_type;
|
||||
|
||||
// select magic.
|
||||
selwakeupfx select_fx;
|
||||
int select_rd_pid;
|
||||
int select_wr_pid;
|
||||
|
||||
unsigned select_rd_collision:1;
|
||||
unsigned select_wr_collision:1;
|
||||
|
||||
// shutdown(2)
|
||||
unsigned _SHUT_RD:1;
|
||||
unsigned _SHUT_WR:1;
|
||||
|
@ -16,6 +16,7 @@ int mattach(int type, void *p1, void *p2, void *p3, void *p4, void *p5)
|
||||
Entry *e;
|
||||
|
||||
// p2 = selwakeup.
|
||||
selwakeupfx fx = (selwakeupfx)p2;
|
||||
int protocol = *(int *)p3;
|
||||
|
||||
if (Debug > 0)
|
||||
@ -42,6 +43,9 @@ int mattach(int type, void *p1, void *p2, void *p3, void *p4, void *p5)
|
||||
TCPIPLogout(ipid);
|
||||
return ENOMEM;
|
||||
}
|
||||
e->select_fx = fx;
|
||||
e->socket_type = type;
|
||||
|
||||
*(Word *)p1 = ipid;
|
||||
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user