Changeset 22573
- Timestamp:
- 07/28/13 08:30:04 (11 years ago)
- Location:
- titan/titan
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
titan/titan/copyfile.h
r22568 r22573 9 9 off64_t count = 0, len = 0; 10 10 unsigned char* buf = NULL; 11 time_t akttime = 0;12 11 13 12 fdfrom = open(from, O_RDONLY); … … 101 100 102 101 end: 103 akttime = time(NULL);104 105 102 if(fdfrom >= 0) 106 103 close(fdfrom); … … 125 122 126 123 //if the code from end to here takes longer then 8 sek, don't use cnode, cnode is freed after 10 sek 127 if(cnode != NULL && (time(NULL) - akttime) < 8) cnode->ret = ret;124 if(cnode != NULL) cnode->ret = ret; 128 125 129 126 return ret; … … 271 268 } 272 269 ret = cnode->ret; 273 free(cnode); cnode = NULL; 270 271 if(count < 10) 272 { 273 free(cnode); 274 cnode = NULL; 275 } 276 else 277 addoldentry((void*)dnode, 2, time(NULL) + 7200, NULL); 274 278 275 279 if(fromthread == 1) -
titan/titan/download.h
r19884 r22573 111 111 } 112 112 ret = dnode->ret; 113 free(dnode); dnode = NULL; 113 114 if(count < 10) 115 { 116 free(dnode); 117 dnode = NULL; 118 } 119 else 120 addoldentry((void*)dnode, 1, time(NULL) + 7200, NULL); 114 121 115 122 if(fromthread == 1) -
titan/titan/header.h
r22484 r22573 63 63 64 64 //oldentry.h 65 struct oldentry* addoldentry(void* entry, int type, time_t del, struct oldentry* last); 65 66 void deloldentry(struct oldentry *entry, int flag); 66 67 -
titan/titan/oldentry.h
r18573 r22573 4 4 void oldentrythreadfunc(struct stimerthread* self) 5 5 { 6 6 debug(401, "start oldentry thread"); 7 7 8 8 m_lock(&status.oldentrymutex, 18); … … 18 18 19 19 m_unlock(&status.oldentrymutex, 18); 20 20 debug(401, "end oldentry thread"); 21 21 } 22 22 23 //type 0: epg 24 //type 1: download 25 //type 2: copyfile 23 26 struct oldentry* addoldentry(void* entry, int type, time_t del, struct oldentry* last) 24 27 { … … 80 83 81 84 if(node->type == 0) 82 {83 85 deloldentryepg(node->entry); 84 node->entry = NULL; 85 } 86 else if(node->type == 1) 87 free(node->entry); 88 else if(node->type == 2) 89 free(node->entry); 90 91 node->entry = NULL; 86 92 87 93 free(node);
Note: See TracChangeset
for help on using the changeset viewer.