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 * ***** 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 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 * If it's application data, ss->gs.buf will not be empty upon return. | 202 * If it's application data, ss->gs.buf will not be empty upon return. |
203 */ | 203 */ |
204 cText.type = (SSL3ContentType)ss->gs.hdr[0]; | 204 cText.type = (SSL3ContentType)ss->gs.hdr[0]; |
205 cText.version = (ss->gs.hdr[1] << 8) | ss->gs.hdr[2]; | 205 cText.version = (ss->gs.hdr[1] << 8) | ss->gs.hdr[2]; |
206 cText.buf = &ss->gs.inbuf; | 206 cText.buf = &ss->gs.inbuf; |
207 rv = ssl3_HandleRecord(ss, &cText, &ss->gs.buf); | 207 rv = ssl3_HandleRecord(ss, &cText, &ss->gs.buf); |
208 if (rv < 0) { | 208 if (rv < 0) { |
209 return ss->recvdCloseNotify ? 0 : rv; | 209 return ss->recvdCloseNotify ? 0 : rv; |
210 } | 210 } |
211 | 211 |
| 212 /* If we kicked off a false start in ssl3_HandleServerHelloDone, break |
| 213 * out of this loop early without finishing the handshake. |
| 214 */ |
212 if (ss->opt.enableFalseStart) { | 215 if (ss->opt.enableFalseStart) { |
213 ssl_GetSSL3HandshakeLock(ss); | 216 ssl_GetSSL3HandshakeLock(ss); |
214 canFalseStart = (ss->ssl3.hs.ws == wait_change_cipher || | 217 canFalseStart = (ss->ssl3.hs.ws == wait_change_cipher || |
215 ss->ssl3.hs.ws == wait_new_session_ticket) && | 218 ss->ssl3.hs.ws == wait_new_session_ticket) && |
216 ssl3_CanFalseStart(ss); | 219 ssl3_CanFalseStart(ss); |
217 ssl_ReleaseSSL3HandshakeLock(ss); | 220 ssl_ReleaseSSL3HandshakeLock(ss); |
218 } | 221 } |
219 } while (ss->ssl3.hs.ws != idle_handshake && | 222 } while (ss->ssl3.hs.ws != idle_handshake && |
220 !canFalseStart && | 223 !canFalseStart && |
221 ss->gs.buf.len == 0); | 224 ss->gs.buf.len == 0); |
(...skipping 19 matching lines...) Expand all Loading... |
241 { | 244 { |
242 int rv; | 245 int rv; |
243 | 246 |
244 PORT_Assert( ss->opt.noLocks || ssl_HaveRecvBufLock(ss) ); | 247 PORT_Assert( ss->opt.noLocks || ssl_HaveRecvBufLock(ss) ); |
245 do { | 248 do { |
246 rv = ssl3_GatherCompleteHandshake(ss, flags); | 249 rv = ssl3_GatherCompleteHandshake(ss, flags); |
247 } while (rv > 0 && ss->gs.buf.len == 0); | 250 } while (rv > 0 && ss->gs.buf.len == 0); |
248 | 251 |
249 return rv; | 252 return rv; |
250 } | 253 } |
OLD | NEW |