Changeset 19570
- Timestamp:
- 01/12/13 13:58:05 (11 years ago)
- Location:
- titan/plugins/tithek
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
titan/plugins/tithek/tithek.c
r19554 r19570 53 53 54 54 status.hangtime = 99999; 55 tithekdownloadrun = 0; 56 tithekdownloadcount = 0; 57 tithekrun = 1; 55 58 screentithekplay("http://atemio.dyndns.tv/mediathek/mainmenu.list", "Tithek - Mainmenu", 1); 59 tithekrun = 0; 56 60 status.hangtime = getconfigint("hangtime", NULL); 57 61 } -
titan/plugins/tithek/tithek.h
r19568 r19570 3 3 4 4 #define TITHEKPATH "/tmp/tithek" 5 int tithekdownloadrun = 0; 6 int tithekdownloadcount = 0; 7 int tithekrun = 0; 5 8 6 9 //flag 0 - menu … … 644 647 void tithekdownloadthread(struct stimerthread* timernode, struct download* node, int flag) 645 648 { 649 tithekdownloadcount++; 646 650 if(node != NULL) 647 651 { 648 652 gethttp(node->host, node->page, node->port, node->filename, node->auth, NULL, 0); 653 654 if(tithekrun == 0) unlink(node->filename); 655 649 656 free(node->host); node->host = NULL; 650 657 free(node->page); node->page = NULL; … … 654 661 655 662 free(node); node = NULL; 663 tithekdownloadcount--; 664 tithekdownloadrun = 1; 656 665 } 657 666 … … 699 708 if(pic == 1) 700 709 { 701 //dnode is freed in thread702 struct download* dnode = calloc(1, sizeof(struct download));703 if(dnode != NULL)710 if(tithekdownloadcount > 100) //start max 100 threads 711 gethttp(ip, path, 80, localfile, pw, NULL, 0); 712 else 704 713 { 705 dnode->host = ostrcat(ip, NULL, 0, 0); 706 dnode->page = ostrcat(path, NULL, 0, 0); 707 dnode->port = 80; 708 dnode->filename = ostrcat(localfile, NULL, 0, 0); 709 dnode->auth = ostrcat(pw, NULL, 0, 0); 710 dnode->connfd = -1; 711 dnode->ret = -1; 712 addtimer(&tithekdownloadthread, START, 100, 1, (void*)dnode, NULL, NULL); 713 //gethttp(ip, path, 80, localfile, pw, NULL, 0); 714 //dnode is freed in thread 715 struct download* dnode = calloc(1, sizeof(struct download)); 716 if(dnode != NULL) 717 { 718 dnode->host = ostrcat(ip, NULL, 0, 0); 719 dnode->page = ostrcat(path, NULL, 0, 0); 720 dnode->port = 80; 721 dnode->filename = ostrcat(localfile, NULL, 0, 0); 722 dnode->auth = ostrcat(pw, NULL, 0, 0); 723 dnode->connfd = -1; 724 dnode->ret = -1; 725 addtimer(&tithekdownloadthread, START, 100, 1, (void*)dnode, NULL, NULL); 726 } 714 727 } 715 728 } … … 1127 1140 if(count > 500) 1128 1141 delallfiles(TITHEKPATH, ".jpg"); 1129 1130 rcret = waitrc(grid, 0, 0); 1142 1143 waitrcstart: 1144 rcret = waitrc(grid, 2000, 0); 1145 1146 if(rcret == RCTIMEOUT) 1147 { 1148 if(tithekdownloadrun == 1) 1149 { 1150 tithekdownloadrun = 0; 1151 drawscreen(grid, 0, 0); 1152 } 1153 goto waitrcstart; 1154 } 1131 1155 1132 1156 if(rcret == getrcconfigint("rcexit", NULL)) break;
Note: See TracChangeset
for help on using the changeset viewer.