Changeset 10143
- Timestamp:
- Feb 8, 2010, 7:21:07 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libtransmission/session.c
r10135 r10143 627 627 } 628 628 629 static void turtleBootstrap( tr_session *, struct tr_turtle_info * , tr_bool isEnabled);629 static void turtleBootstrap( tr_session *, struct tr_turtle_info * ); 630 630 631 631 static void … … 779 779 if( tr_bencDictFindBool( settings, TR_PREFS_KEY_ALT_SPEED_TIME_ENABLED, &boolVal ) ) 780 780 turtle->isClockEnabled = boolVal; 781 782 if( !tr_bencDictFindBool( settings, TR_PREFS_KEY_ALT_SPEED_ENABLED, &boolVal ) ) 783 boolVal = FALSE; 784 turtleBootstrap( session, turtle, boolVal ); 781 turtleBootstrap( session, turtle ); 785 782 786 783 data->done = TRUE; … … 1154 1151 } 1155 1152 1156 static tr_bool1157 turtleTestClock( struct tr_turtle_info * t, tr_bool * enabled )1158 {1159 tr_bool hit;1160 1161 if(( hit = ( t->testedAt < t->_nextChangeAt ) && ( t->_nextChangeAt <= tr_time( ))))1162 *enabled = t->_nextChangeValue;1163 1164 return hit;1165 }1166 1167 1153 static void 1168 1154 turtleCheckClock( tr_session * session, struct tr_turtle_info * t, tr_bool byUser ) 1169 1155 { 1170 tr_bool enabled;1171 1156 const time_t now = tr_time( ); 1172 const tr_bool hit = turtleTestClock( t, &enabled);1157 const tr_bool hit = ( t->testedAt < t->_nextChangeAt ) && ( t->_nextChangeAt <= tr_time( )); 1173 1158 1174 1159 t->testedAt = now; … … 1176 1161 if( hit ) 1177 1162 { 1163 const tr_bool enabled = t->_nextChangeValue; 1164 1178 1165 if( t->isClockEnabled && t->_nextChangeAllowed ) 1179 1166 { … … 1190 1177 * and turns on turtle mode if the clock settings say to. */ 1191 1178 static void 1192 turtleBootstrap( tr_session * session, struct tr_turtle_info * turtle, tr_bool isEnabled ) 1193 { 1179 turtleBootstrap( tr_session * session, struct tr_turtle_info * turtle ) 1180 { 1181 tr_bool isEnabled; 1182 1194 1183 turtleFindNextChange( turtle ); 1195 1196 if( !isEnabled ) 1197 turtleTestClock( turtle, &isEnabled ); 1198 1184 isEnabled = turtle->isClockEnabled && !turtle->_nextChangeValue; 1199 1185 useAltSpeed( session, turtle, isEnabled, FALSE ); 1200 1186 }
Note: See TracChangeset
for help on using the changeset viewer.