| OLD | NEW |
| 1 /* | 1 /* |
| 2 * "Default" SSLSocket methods, used by sockets that do neither SSL nor socks. | 2 * "Default" SSLSocket methods, used by sockets that do neither SSL nor socks. |
| 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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 if (err == PR_WOULD_BLOCK_ERROR) { | 131 if (err == PR_WOULD_BLOCK_ERROR) { |
| 132 ss->lastWriteBlocked = 1; | 132 ss->lastWriteBlocked = 1; |
| 133 return sent ? sent : SECFailure; | 133 return sent ? sent : SECFailure; |
| 134 } | 134 } |
| 135 ss->lastWriteBlocked = 0; | 135 ss->lastWriteBlocked = 0; |
| 136 MAP_ERROR(PR_CONNECT_ABORTED_ERROR, PR_CONNECT_RESET_ERROR) | 136 MAP_ERROR(PR_CONNECT_ABORTED_ERROR, PR_CONNECT_RESET_ERROR) |
| 137 /* Loser */ | 137 /* Loser */ |
| 138 return rv; | 138 return rv; |
| 139 } | 139 } |
| 140 sent += rv; | 140 sent += rv; |
| 141 |
| 142 if (IS_DTLS(ss) && (len > sent)) { |
| 143 /* We got a partial write so just return it */ |
| 144 return sent; |
| 145 } |
| 141 } while (len > sent); | 146 } while (len > sent); |
| 142 ss->lastWriteBlocked = 0; | 147 ss->lastWriteBlocked = 0; |
| 143 return sent; | 148 return sent; |
| 144 } | 149 } |
| 145 | 150 |
| 146 int ssl_DefRead(sslSocket *ss, unsigned char *buf, int len) | 151 int ssl_DefRead(sslSocket *ss, unsigned char *buf, int len) |
| 147 { | 152 { |
| 148 PRFileDesc *lower = ss->fd->lower; | 153 PRFileDesc *lower = ss->fd->lower; |
| 149 int rv; | 154 int rv; |
| 150 | 155 |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 ** Now close the underlying socket. | 234 ** Now close the underlying socket. |
| 230 */ | 235 */ |
| 231 rv = fd->methods->close(fd); | 236 rv = fd->methods->close(fd); |
| 232 | 237 |
| 233 ssl_FreeSocket(ss); | 238 ssl_FreeSocket(ss); |
| 234 | 239 |
| 235 SSL_TRC(5, ("%d: SSL[%d]: closing, rv=%d errno=%d", | 240 SSL_TRC(5, ("%d: SSL[%d]: closing, rv=%d errno=%d", |
| 236 SSL_GETPID(), fd, rv, PORT_GetError())); | 241 SSL_GETPID(), fd, rv, PORT_GetError())); |
| 237 return rv; | 242 return rv; |
| 238 } | 243 } |
| OLD | NEW |