Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1239)

Side by Side Diff: net/third_party/nss/ssl/dtls1con.c

Issue 10693078: Rename DTLS_GetTimeout to DTLS_GetHandshakeTimeout (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/third_party/nss/patches/dtls.patch ('k') | net/third_party/nss/ssl/ssl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * DTLS Protocol 2 * DTLS Protocol
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 1116 matching lines...) Expand 10 before | Expand all | Expand 10 after
1127 records->right = new_right; 1127 records->right = new_right;
1128 records->left = new_left; 1128 records->left = new_left;
1129 } 1129 }
1130 1130
1131 offset = seq % DTLS_RECVD_RECORDS_WINDOW; 1131 offset = seq % DTLS_RECVD_RECORDS_WINDOW;
1132 1132
1133 records->data[offset / 8] |= (1 << (offset % 8)); 1133 records->data[offset / 8] |= (1 << (offset % 8));
1134 } 1134 }
1135 1135
1136 SECStatus 1136 SECStatus
1137 DTLS_GetTimeout(PRFileDesc *socket, PRIntervalTime *timeout) 1137 DTLS_GetHandshakeTimeout(PRFileDesc *socket, PRIntervalTime *timeout)
1138 { 1138 {
1139 sslSocket * ss = NULL; 1139 sslSocket * ss = NULL;
1140 PRIntervalTime elapsed; 1140 PRIntervalTime elapsed;
1141 PRIntervalTime desired; 1141 PRIntervalTime desired;
1142 1142
1143 ss = ssl_FindSocket(socket); 1143 ss = ssl_FindSocket(socket);
1144 1144
1145 if (!ss) 1145 if (!ss)
1146 return SECFailure; 1146 return SECFailure;
1147 1147
1148 if (!IS_DTLS(ss)) 1148 if (!IS_DTLS(ss))
1149 return SECFailure; 1149 return SECFailure;
1150 1150
1151 if (!ss->ssl3.hs.rtTimerCb) 1151 if (!ss->ssl3.hs.rtTimerCb)
1152 return SECFailure; 1152 return SECFailure;
1153 1153
1154 elapsed = PR_IntervalNow() - ss->ssl3.hs.rtTimerStarted; 1154 elapsed = PR_IntervalNow() - ss->ssl3.hs.rtTimerStarted;
1155 desired = PR_MillisecondsToInterval(ss->ssl3.hs.rtTimeoutMs); 1155 desired = PR_MillisecondsToInterval(ss->ssl3.hs.rtTimeoutMs);
1156 if (elapsed > desired) { 1156 if (elapsed > desired) {
1157 /* Timer expired */ 1157 /* Timer expired */
1158 *timeout = PR_INTERVAL_NO_WAIT; 1158 *timeout = PR_INTERVAL_NO_WAIT;
1159 } else { 1159 } else {
1160 *timeout = desired - elapsed; 1160 *timeout = desired - elapsed;
1161 } 1161 }
1162 1162
1163 return SECSuccess; 1163 return SECSuccess;
1164 } 1164 }
OLDNEW
« no previous file with comments | « net/third_party/nss/patches/dtls.patch ('k') | net/third_party/nss/ssl/ssl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698