| OLD | NEW |
| 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 Loading... |
| 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); |
| 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 Loading... |
| 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 } |
| OLD | NEW |