зеркало из https://github.com/mozilla/pjs.git
Bugzilla bug 276170: fixed unused variable addrp on some platforms.
Fixed the bug that addr rather than addrp was used. r=timeless,darin.
This commit is contained in:
Родитель
e8e27ae8e6
Коммит
883773fb83
|
@ -1582,10 +1582,9 @@ static PRStatus pt_Connect(
|
||||||
addrCopy = *addr;
|
addrCopy = *addr;
|
||||||
((struct sockaddr*)&addrCopy)->sa_len = addr_len;
|
((struct sockaddr*)&addrCopy)->sa_len = addr_len;
|
||||||
((struct sockaddr*)&addrCopy)->sa_family = md_af;
|
((struct sockaddr*)&addrCopy)->sa_family = md_af;
|
||||||
rv = connect(fd->secret->md.osfd, (struct sockaddr*)&addrCopy, addr_len);
|
addrp = &addrCopy;
|
||||||
#else
|
|
||||||
rv = connect(fd->secret->md.osfd, (struct sockaddr*)addrp, addr_len);
|
|
||||||
#endif
|
#endif
|
||||||
|
rv = connect(fd->secret->md.osfd, (struct sockaddr*)addrp, addr_len);
|
||||||
syserrno = errno;
|
syserrno = errno;
|
||||||
if ((-1 == rv) && (EINPROGRESS == syserrno) && (!fd->secret->nonblocking))
|
if ((-1 == rv) && (EINPROGRESS == syserrno) && (!fd->secret->nonblocking))
|
||||||
{
|
{
|
||||||
|
@ -1594,11 +1593,7 @@ static PRStatus pt_Connect(
|
||||||
{
|
{
|
||||||
pt_Continuation op;
|
pt_Continuation op;
|
||||||
op.arg1.osfd = fd->secret->md.osfd;
|
op.arg1.osfd = fd->secret->md.osfd;
|
||||||
#ifdef _PR_HAVE_SOCKADDR_LEN
|
op.arg2.buffer = (void*)addrp;
|
||||||
op.arg2.buffer = (void*)&addrCopy;
|
|
||||||
#else
|
|
||||||
op.arg2.buffer = (void*)addr;
|
|
||||||
#endif
|
|
||||||
op.arg3.amount = addr_len;
|
op.arg3.amount = addr_len;
|
||||||
op.timeout = timeout;
|
op.timeout = timeout;
|
||||||
op.function = pt_connect_cont;
|
op.function = pt_connect_cont;
|
||||||
|
@ -1777,10 +1772,9 @@ static PRStatus pt_Bind(PRFileDesc *fd, const PRNetAddr *addr)
|
||||||
addrCopy = *addr;
|
addrCopy = *addr;
|
||||||
((struct sockaddr*)&addrCopy)->sa_len = addr_len;
|
((struct sockaddr*)&addrCopy)->sa_len = addr_len;
|
||||||
((struct sockaddr*)&addrCopy)->sa_family = md_af;
|
((struct sockaddr*)&addrCopy)->sa_family = md_af;
|
||||||
rv = bind(fd->secret->md.osfd, (struct sockaddr*)&addrCopy, addr_len);
|
addrp = &addrCopy;
|
||||||
#else
|
|
||||||
rv = bind(fd->secret->md.osfd, (struct sockaddr*)addrp, addr_len);
|
|
||||||
#endif
|
#endif
|
||||||
|
rv = bind(fd->secret->md.osfd, (struct sockaddr*)addrp, addr_len);
|
||||||
|
|
||||||
if (rv == -1) {
|
if (rv == -1) {
|
||||||
pt_MapError(_PR_MD_MAP_BIND_ERROR, errno);
|
pt_MapError(_PR_MD_MAP_BIND_ERROR, errno);
|
||||||
|
@ -2017,14 +2011,11 @@ static PRInt32 pt_SendTo(
|
||||||
addrCopy = *addr;
|
addrCopy = *addr;
|
||||||
((struct sockaddr*)&addrCopy)->sa_len = addr_len;
|
((struct sockaddr*)&addrCopy)->sa_len = addr_len;
|
||||||
((struct sockaddr*)&addrCopy)->sa_family = md_af;
|
((struct sockaddr*)&addrCopy)->sa_family = md_af;
|
||||||
bytes = sendto(
|
addrp = &addrCopy;
|
||||||
fd->secret->md.osfd, buf, amount, flags,
|
#endif
|
||||||
(struct sockaddr*)&addrCopy, addr_len);
|
|
||||||
#else
|
|
||||||
bytes = sendto(
|
bytes = sendto(
|
||||||
fd->secret->md.osfd, buf, amount, flags,
|
fd->secret->md.osfd, buf, amount, flags,
|
||||||
(struct sockaddr*)addrp, addr_len);
|
(struct sockaddr*)addrp, addr_len);
|
||||||
#endif
|
|
||||||
syserrno = errno;
|
syserrno = errno;
|
||||||
if ( (bytes == -1) && (syserrno == EWOULDBLOCK || syserrno == EAGAIN)
|
if ( (bytes == -1) && (syserrno == EWOULDBLOCK || syserrno == EAGAIN)
|
||||||
&& (!fd->secret->nonblocking) )
|
&& (!fd->secret->nonblocking) )
|
||||||
|
@ -2039,11 +2030,7 @@ static PRInt32 pt_SendTo(
|
||||||
op.arg2.buffer = (void*)buf;
|
op.arg2.buffer = (void*)buf;
|
||||||
op.arg3.amount = amount;
|
op.arg3.amount = amount;
|
||||||
op.arg4.flags = flags;
|
op.arg4.flags = flags;
|
||||||
#ifdef _PR_HAVE_SOCKADDR_LEN
|
op.arg5.addr = (PRNetAddr*)addrp;
|
||||||
op.arg5.addr = (PRNetAddr*)&addrCopy;
|
|
||||||
#else
|
|
||||||
op.arg5.addr = (PRNetAddr*)addr;
|
|
||||||
#endif
|
|
||||||
op.timeout = timeout;
|
op.timeout = timeout;
|
||||||
op.result.code = 0; /* initialize the number sent */
|
op.result.code = 0; /* initialize the number sent */
|
||||||
op.function = pt_sendto_cont;
|
op.function = pt_sendto_cont;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче