Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(262)

Side by Side Diff: net/third_party/nss/ssl/sslsecur.c

Issue 9764001: Add DTLS support to NSS, contributed by Eric Rescorla. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Made one pass, dtls1con.c not reviewed yet Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Various SSL functions. 2 * Various SSL functions.
3 * 3 *
4 * ***** BEGIN LICENSE BLOCK ***** 4 * ***** BEGIN LICENSE BLOCK *****
5 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 5 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
6 * 6 *
7 * The contents of this file are subject to the Mozilla Public License Version 7 * The contents of this file are subject to the Mozilla Public License Version
8 * 1.1 (the "License"); you may not use this file except in compliance with 8 * 1.1 (the "License"); you may not use this file except in compliance with
9 * the License. You may obtain a copy of the License at 9 * the License. You may obtain a copy of the License at
10 * http://www.mozilla.org/MPL/ 10 * http://www.mozilla.org/MPL/
(...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after
608 SSL_TRC(30, ("%d: SSL[%d]: partial data ready, available=%d", 608 SSL_TRC(30, ("%d: SSL[%d]: partial data ready, available=%d",
609 SSL_GETPID(), ss->fd, available)); 609 SSL_GETPID(), ss->fd, available));
610 } 610 }
611 611
612 /* Dole out clear data to reader */ 612 /* Dole out clear data to reader */
613 amount = PR_MIN(len, available); 613 amount = PR_MIN(len, available);
614 PORT_Memcpy(out, ss->gs.buf.buf + ss->gs.readOffset, amount); 614 PORT_Memcpy(out, ss->gs.buf.buf + ss->gs.readOffset, amount);
615 if (!(flags & PR_MSG_PEEK)) { 615 if (!(flags & PR_MSG_PEEK)) {
616 ss->gs.readOffset += amount; 616 ss->gs.readOffset += amount;
617 } 617 }
618 PORT_Assert(ss->gs.readOffset <= ss->gs.writeOffset);
wtc 2012/03/21 23:12:16 Nit: should we assert the invariant before the ret
ekr 2012/03/22 15:07:17 I'm not sure about the first question, but your la
618 rv = amount; 619 rv = amount;
619 620
620 SSL_TRC(30, ("%d: SSL[%d]: amount=%d available=%d", 621 SSL_TRC(30, ("%d: SSL[%d]: amount=%d available=%d",
621 SSL_GETPID(), ss->fd, amount, available)); 622 SSL_GETPID(), ss->fd, amount, available));
622 PRINT_BUF(4, (ss, "DoRecv receiving plaintext:", out, amount)); 623 PRINT_BUF(4, (ss, "DoRecv receiving plaintext:", out, amount));
623 624
624 done: 625 done:
625 ssl_ReleaseRecvBufLock(ss); 626 ssl_ReleaseRecvBufLock(ss);
626 return rv; 627 return rv;
627 } 628 }
(...skipping 957 matching lines...) Expand 10 before | Expand all | Expand 10 after
1585 if (!ss) { 1586 if (!ss) {
1586 SSL_DBG(("%d: SSL[%d]: bad socket in SNISocketConfigHook", 1587 SSL_DBG(("%d: SSL[%d]: bad socket in SNISocketConfigHook",
1587 SSL_GETPID(), fd)); 1588 SSL_GETPID(), fd));
1588 return SECFailure; 1589 return SECFailure;
1589 } 1590 }
1590 1591
1591 ss->sniSocketConfig = func; 1592 ss->sniSocketConfig = func;
1592 ss->sniSocketConfigArg = arg; 1593 ss->sniSocketConfigArg = arg;
1593 return SECSuccess; 1594 return SECSuccess;
1594 } 1595 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698