| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Gather (Read) entire SSL3 records from socket into buffer. | 2 * Gather (Read) entire SSL3 records from socket into buffer. |
| 3 * | 3 * |
| 4 * This Source Code Form is subject to the terms of the Mozilla Public | 4 * This Source Code Form is subject to the terms of the Mozilla Public |
| 5 * License, v. 2.0. If a copy of the MPL was not distributed with this | 5 * License, v. 2.0. If a copy of the MPL was not distributed with this |
| 6 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | 6 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
| 7 | 7 |
| 8 #include "cert.h" | 8 #include "cert.h" |
| 9 #include "ssl.h" | 9 #include "ssl.h" |
| 10 #include "sslimpl.h" | 10 #include "sslimpl.h" |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 SSL_TRC(30, ("%d: SSL3[%d]: EOF", SSL_GETPID(), ss->fd)); | 64 SSL_TRC(30, ("%d: SSL3[%d]: EOF", SSL_GETPID(), ss->fd)); |
| 65 rv = 0; | 65 rv = 0; |
| 66 break; | 66 break; |
| 67 } else /* if (nb < 0) */ { | 67 } else /* if (nb < 0) */ { |
| 68 SSL_DBG(("%d: SSL3[%d]: recv error %d", SSL_GETPID(), ss->fd, | 68 SSL_DBG(("%d: SSL3[%d]: recv error %d", SSL_GETPID(), ss->fd, |
| 69 PR_GetError())); | 69 PR_GetError())); |
| 70 rv = SECFailure; | 70 rv = SECFailure; |
| 71 break; | 71 break; |
| 72 } | 72 } |
| 73 | 73 |
| 74 » PORT_Assert( nb <= gs->remainder ); | 74 » PORT_Assert( (unsigned int)nb <= gs->remainder ); |
| 75 » if (nb > gs->remainder) { | 75 » if ((unsigned int)nb > gs->remainder) { |
| 76 /* ssl_DefRecv is misbehaving! this error is fatal to SSL. */ | 76 /* ssl_DefRecv is misbehaving! this error is fatal to SSL. */ |
| 77 gs->state = GS_INIT; /* so we don't crash next time */ | 77 gs->state = GS_INIT; /* so we don't crash next time */ |
| 78 rv = SECFailure; | 78 rv = SECFailure; |
| 79 break; | 79 break; |
| 80 } | 80 } |
| 81 | 81 |
| 82 gs->offset += nb; | 82 gs->offset += nb; |
| 83 gs->remainder -= nb; | 83 gs->remainder -= nb; |
| 84 if (gs->state == GS_DATA) | 84 if (gs->state == GS_DATA) |
| 85 gs->inbuf.len += nb; | 85 gs->inbuf.len += nb; |
| (...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 446 /* ssl3_GatherCompleteHandshake requires both of these locks. */ | 446 /* ssl3_GatherCompleteHandshake requires both of these locks. */ |
| 447 PORT_Assert( ss->opt.noLocks || ssl_Have1stHandshakeLock(ss) ); | 447 PORT_Assert( ss->opt.noLocks || ssl_Have1stHandshakeLock(ss) ); |
| 448 PORT_Assert( ss->opt.noLocks || ssl_HaveRecvBufLock(ss) ); | 448 PORT_Assert( ss->opt.noLocks || ssl_HaveRecvBufLock(ss) ); |
| 449 | 449 |
| 450 do { | 450 do { |
| 451 rv = ssl3_GatherCompleteHandshake(ss, flags); | 451 rv = ssl3_GatherCompleteHandshake(ss, flags); |
| 452 } while (rv > 0 && ss->gs.buf.len == 0); | 452 } while (rv > 0 && ss->gs.buf.len == 0); |
| 453 | 453 |
| 454 return rv; | 454 return rv; |
| 455 } | 455 } |
| OLD | NEW |