From bc5774d577d43989a818cd18f752b0efbf4133a6 Mon Sep 17 00:00:00 2001 From: "jpierre%netscape.com" Date: Tue, 11 May 2004 03:48:25 +0000 Subject: [PATCH] Fix for 242984 - crash with application having incomplete PRIOMethods. r=nelsonb,wtc git-svn-id: svn://10.0.0.236/trunk@156222 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/security/nss/lib/ssl/sslsock.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/mozilla/security/nss/lib/ssl/sslsock.c b/mozilla/security/nss/lib/ssl/sslsock.c index e73390960d2..4f67a909d2a 100644 --- a/mozilla/security/nss/lib/ssl/sslsock.c +++ b/mozilla/security/nss/lib/ssl/sslsock.c @@ -40,7 +40,7 @@ * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -/* $Id: sslsock.c,v 1.33 2004-04-27 23:04:39 gerv%gerv.net Exp $ */ +/* $Id: sslsock.c,v 1.34 2004-05-11 03:48:25 jpierre%netscape.com Exp $ */ #include "seccomon.h" #include "cert.h" #include "keyhi.h" @@ -459,13 +459,17 @@ SECStatus ssl_EnableNagleDelay(sslSocket *ss, PRBool enabled) { PRFileDesc * osfd = ss->fd->lower; - int rv; + SECStatus rv = SECFailure; PRSocketOptionData opt; opt.option = PR_SockOpt_NoDelay; opt.value.no_delay = (PRBool)!enabled; - rv = osfd->methods->setsocketoption(osfd, &opt); + if (osfd->methods->setsocketoption) { + rv = (SECStatus) osfd->methods->setsocketoption(osfd, &opt); + } else { + PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0); + } return rv; }