OLD | NEW |
1 /* | 1 /* |
2 * vtables (and methods that call through them) for the 4 types of | 2 * vtables (and methods that call through them) for the 4 types of |
3 * SSLSockets supported. Only one type is still supported. | 3 * SSLSockets supported. Only one type is still supported. |
4 * Various other functions. | 4 * Various other functions. |
5 * | 5 * |
6 * This Source Code Form is subject to the terms of the Mozilla Public | 6 * This Source Code Form is subject to the terms of the Mozilla Public |
7 * License, v. 2.0. If a copy of the MPL was not distributed with this | 7 * License, v. 2.0. If a copy of the MPL was not distributed with this |
8 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | 8 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
9 #include "seccomon.h" | 9 #include "seccomon.h" |
10 #include "cert.h" | 10 #include "cert.h" |
(...skipping 2437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2448 ** but the initial handshake is blocked on write, or the | 2448 ** but the initial handshake is blocked on write, or the |
2449 ** client's first handshake record has not been written. | 2449 ** client's first handshake record has not been written. |
2450 ** The code should select on write, not read. | 2450 ** The code should select on write, not read. |
2451 */ | 2451 */ |
2452 new_flags ^= PR_POLL_READ; /* don't select on read. */ | 2452 new_flags ^= PR_POLL_READ; /* don't select on read. */ |
2453 new_flags |= PR_POLL_WRITE; /* do select on write. */ | 2453 new_flags |= PR_POLL_WRITE; /* do select on write. */ |
2454 } | 2454 } |
2455 } else if (new_flags & PR_POLL_WRITE) { | 2455 } else if (new_flags & PR_POLL_WRITE) { |
2456 /* The caller is trying to write, but the handshake is | 2456 /* The caller is trying to write, but the handshake is |
2457 ** blocked waiting for data to read, and the first | 2457 ** blocked waiting for data to read, and the first |
2458 » » ** handshake has been sent. so do NOT to poll on write. | 2458 » » ** handshake has been sent. So do NOT to poll on write |
| 2459 » » ** unless we did false start. |
2459 */ | 2460 */ |
2460 » » new_flags ^= PR_POLL_WRITE; /* don't select on write. */ | 2461 » » if (!(ss->version >= SSL_LIBRARY_VERSION_3_0 && |
| 2462 » » » ss->ssl3.hs.canFalseStart)) { |
| 2463 » » » new_flags ^= PR_POLL_WRITE; /* don't select on write.
*/ |
| 2464 » » } |
2461 new_flags |= PR_POLL_READ; /* do select on read. */ | 2465 new_flags |= PR_POLL_READ; /* do select on read. */ |
2462 } | 2466 } |
2463 } | 2467 } |
2464 } else if ((new_flags & PR_POLL_READ) && (SSL_DataPending(fd) > 0)) { | 2468 } else if ((new_flags & PR_POLL_READ) && (SSL_DataPending(fd) > 0)) { |
2465 *p_out_flags = PR_POLL_READ; /* it's ready already. */ | 2469 *p_out_flags = PR_POLL_READ; /* it's ready already. */ |
2466 return new_flags; | 2470 return new_flags; |
2467 } else if ((ss->lastWriteBlocked) && (how_flags & PR_POLL_READ) && | 2471 } else if ((ss->lastWriteBlocked) && (how_flags & PR_POLL_READ) && |
2468 (ss->pendingBuf.len != 0)) { /* write data waiting to be sent */ | 2472 (ss->pendingBuf.len != 0)) { /* write data waiting to be sent */ |
2469 new_flags |= PR_POLL_WRITE; /* also select on write. */ | 2473 new_flags |= PR_POLL_WRITE; /* also select on write. */ |
2470 } | 2474 } |
(...skipping 648 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3119 loser: | 3123 loser: |
3120 ssl_DestroySocketContents(ss); | 3124 ssl_DestroySocketContents(ss); |
3121 ssl_DestroyLocks(ss); | 3125 ssl_DestroyLocks(ss); |
3122 PORT_Free(ss); | 3126 PORT_Free(ss); |
3123 ss = NULL; | 3127 ss = NULL; |
3124 } | 3128 } |
3125 } | 3129 } |
3126 return ss; | 3130 return ss; |
3127 } | 3131 } |
3128 | 3132 |
OLD | NEW |