Fix for Mac OT bugs #2133, #2405, #2451, #2623, #3580 among others. Steve Dagley served as buddy for my changes. This is basically the first half of the redesign for Mac NSPR Sockets. Blocking mode or Server sockets remain to be implemented.
git-svn-id: svn://10.0.0.236/trunk@24086 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
f636dbb228
commit
36fad31c19
@ -51,12 +51,11 @@ struct _MDProcess {
|
||||
};
|
||||
|
||||
struct _MDThread {
|
||||
jmp_buf jb;
|
||||
int osErrCode;
|
||||
PRLock *asyncIOLock;
|
||||
PRCondVar *asyncIOCVar;
|
||||
void *cookie;
|
||||
PRBool notifyPending;
|
||||
jmp_buf jb;
|
||||
int osErrCode;
|
||||
PRLock * asyncIOLock;
|
||||
PRCondVar * asyncIOCVar;
|
||||
PRBool notifyPending;
|
||||
};
|
||||
|
||||
struct _MDThreadStack {
|
||||
@ -83,8 +82,21 @@ struct _MDCPU {
|
||||
PRInt8 notused;
|
||||
};
|
||||
|
||||
typedef struct _MDSocketCallerInfo {
|
||||
PRThread * thread;
|
||||
void * cookie;
|
||||
} _MDSocketCallerInfo;
|
||||
|
||||
struct _MDFileDesc {
|
||||
PRInt32 osfd;
|
||||
PRInt32 osfd;
|
||||
PRBool connectionOpen;
|
||||
PRBool readReady;
|
||||
PRBool writeReady;
|
||||
PRBool exceptReady;
|
||||
PRLock * miscLock;
|
||||
_MDSocketCallerInfo misc;
|
||||
_MDSocketCallerInfo read;
|
||||
_MDSocketCallerInfo write;
|
||||
};
|
||||
|
||||
/*
|
||||
@ -377,7 +389,8 @@ extern PRStatus _MD_setsockopt(PRFileDesc *fd, PRInt32 level, PRInt32 optname, c
|
||||
#define _MD_SENDTO _MD_sendto
|
||||
#define _MD_RECVFROM _MD_recvfrom
|
||||
#define _MD_PR_POLL _MD_poll
|
||||
#define _MD_INIT_FILEDESC(fd)
|
||||
#define _MD_INIT_FILEDESC _MD_initfiledesc
|
||||
#define _MD_FREE_FILEDESC _MD_freefiledesc
|
||||
#define _MD_MAKE_NONBLOCK _MD_makenonblock
|
||||
|
||||
#define _MD_GET_SOCKET_ERROR() _PR_MD_CURRENT_THREAD()->md.osErrCode
|
||||
|
||||
@ -977,6 +977,11 @@ extern PRInt32 _PR_MD_CLOSE_DIR(_MDDir *md);
|
||||
extern void _PR_MD_INIT_FILEDESC(PRFileDesc *fd);
|
||||
#define _PR_MD_INIT_FILEDESC _MD_INIT_FILEDESC
|
||||
|
||||
#ifdef XP_MAC
|
||||
extern void _PR_MD_FREE_FILEDESC(PRFileDesc *fd);
|
||||
#define _PR_MD_FREE_FILEDESC _MD_FREE_FILEDESC
|
||||
#endif
|
||||
|
||||
extern void _PR_MD_MAKE_NONBLOCK(PRFileDesc *fd);
|
||||
#define _PR_MD_MAKE_NONBLOCK _MD_MAKE_NONBLOCK
|
||||
|
||||
|
||||
@ -101,6 +101,9 @@ PR_IMPLEMENT(PRFileDesc*) PR_AllocFileDesc(
|
||||
PR_IMPLEMENT(void) PR_FreeFileDesc(PRFileDesc *fd)
|
||||
{
|
||||
PR_ASSERT(fd);
|
||||
#ifdef XP_MAC
|
||||
_PR_MD_FREE_FILEDESC(fd);
|
||||
#endif
|
||||
_PR_Putfd(fd);
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user