UPGRADE_NSPR_RELEASE This is a temporary change to the nspr code in mozilla-central. We believe we have identified a fix to TCP Fast open feature crashes. We would like to verify the fix before making changes in nspr and investing time in doing a proper fix in nspr. The issue has been discussed over e-mails and this push is justifiable before commiitting changes to nspr. Overwriting this push by a new nspr release will not break mozilla-central it will only disable the TCP fast open feature. Patch has been reviewed in bug 1384633. r=mcmanus r=:kaie: r=mayhemer a=jduell a=mcmanus

This commit is contained in:
Dragana Damjanovic 2017-08-10 23:25:31 +02:00
Родитель 201dd4a9e1
Коммит 77398bcd88
4 изменённых файлов: 52 добавлений и 0 удалений

Просмотреть файл

@ -237,6 +237,19 @@ NSPR_API(PRStatus) PR_NT_CancelIo(PRFileDesc *fd);
#endif /* WIN32 */
/* FUNCTION: PR_FileDesc2PlatformOverlappedIOHandle
** DESCRIPTION:
** This functionality is only available on windows. Some windows operation use
** asynchronous (call overlapped) io. One of them is ConnectEx. NSPR uses
** ConnectEx for enabling TCP Fast Open.
** This function returns an OVERLAPPED structure associated with ConnectEx call.
** If ConnectEx has not been called or the io has already finished, the
** function will return PR_INVALID_ARGUMENT_ERROR.
** PRFileDesc continues to be owner of the structure and the structure must not
** be destroyed.
*/
NSPR_API(PRStatus) PR_FileDesc2PlatformOverlappedIOHandle(PRFileDesc *fd, void **ol);
PR_END_EXTERN_C
#endif /* pprio_h___ */

Просмотреть файл

@ -1666,6 +1666,33 @@ PR_ChangeFileDescNativeHandle(PRFileDesc *fd, PROsfd handle)
fd->secret->md.osfd = handle;
}
/* Expose OVERLAPPED if present. OVERLAPPED is implemented only on WIN95. */
PR_IMPLEMENT(PRStatus)
PR_FileDesc2PlatformOverlappedIOHandle(PRFileDesc *fd, void **ol)
{
#if defined(_WIN64) && defined(WIN95)
*ol = NULL;
if (fd) {
fd = PR_GetIdentitiesLayer(fd, PR_NSPR_IO_LAYER);
}
if (!fd) {
PR_SetError(PR_INVALID_ARGUMENT_ERROR, 0);
return PR_FAILURE;
}
if (!fd->secret->overlappedActive) {
PR_SetError(PR_INVALID_ARGUMENT_ERROR, 0);
return PR_FAILURE;
}
*ol = &fd->secret->ol;
return PR_SUCCESS;
#else
PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0);
return PR_FAILURE;
#endif
}
/*
** Select compatibility
**

Просмотреть файл

@ -462,3 +462,7 @@ EXPORTS ;-
PR_DuplicateEnvironment;
PR_GetEnvSecure;
;+} NSPR_4.10.3;
;+NSPR_4.16 {
;+ global:
PR_FileDesc2PlatformOverlappedIOHandle;
;+} NSPR_4.15;

Просмотреть файл

@ -4744,6 +4744,14 @@ PR_IMPLEMENT(PRInt32) PR_FileDesc2NativeHandle(PRFileDesc *bottom)
return osfd;
} /* PR_FileDesc2NativeHandle */
/* Expose OVERLAPPED if present. OVERLAPPED is implemented only on WIN95. */
PR_IMPLEMENT(PRStatus)
PR_FileDesc2PlatformOverlappedIOHandle(PRFileDesc *fd, void **ol)
{
PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0);
return PR_FAILURE;
}
PR_IMPLEMENT(void) PR_ChangeFileDescNativeHandle(PRFileDesc *fd,
PRInt32 handle)
{