Changeset 10839
- Timestamp:
- 10/31/11 02:51:46 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
titan/titan/httpdfunc.h
r10833 r10839 87 87 } 88 88 89 void webcreatechannelbody(char** buf, int line, struct channel* chnode, int* maxlen, int* pos, int flag)89 void webcreatechannelbody(char** buf, int line, struct channel* chnode, char* channellist, int* maxlen, int* pos, int flag) 90 90 { 91 91 char* tmpstr = NULL, *buf1 = NULL, *serviceid = NULL, *transponderid = NULL; … … 133 133 ostrcatbig(buf, "&", maxlen, pos); 134 134 ostrcatbig(buf, transponderid, maxlen, pos); 135 ostrcatbig(buf, "&", maxlen, pos); 136 ostrcatbig(buf, channellist, maxlen, pos); 135 137 ostrcatbig(buf, ">", maxlen, pos); 136 138 } … … 245 247 char* webgetbouquetchannel(char* param) 246 248 { 247 char* buf = NULL ;249 char* buf = NULL, *tmpstr = NULL, *tmpstr1 = NULL; 248 250 struct mainbouquet *mbouquet = NULL; 249 251 struct bouquet *node = NULL; … … 259 261 { 260 262 node = mbouquet->bouquet; 263 tmpstr = ostrcat(tmpstr, "(BOUQUET)-", 1, 0); 264 tmpstr = ostrcat(tmpstr, mbouquet->name, 1, 0); 265 tmpstr1 = htmlencode(tmpstr); 266 free(tmpstr); tmpstr = NULL; 261 267 while(node != NULL) 262 268 { … … 264 270 if(chnode != NULL) 265 271 { 266 webcreatechannelbody(&buf, line, chnode, &maxlen, &pos, 0);272 webcreatechannelbody(&buf, line, chnode, tmpstr1, &maxlen, &pos, 0); 267 273 if(line == 0) 268 274 line = 1; … … 270 276 line = 0; 271 277 } 272 273 278 node = node->next; 274 279 } 280 free(tmpstr1); tmpstr1 = NULL; 275 281 } 276 282 webcreatetailbig(&buf, &maxlen, &pos, 0); … … 285 291 char* webgetchannel(int param, int flag, int page) 286 292 { 287 char* buf = NULL, *tmpnr = NULL ;293 char* buf = NULL, *tmpnr = NULL, *tmpstr = NULL, *tmpstr1 = NULL; 288 294 struct channel* chnode = channel; 289 295 int line = 0, maxcount = 0, maxlen = 0, pos = 0; … … 291 297 webcreateheadbig(&buf, &maxlen, "<meta http-equiv=refresh content=15>", &pos, 0); 292 298 299 if(flag == 0) tmpstr1 = ostrcat(tmpstr1, "(ALL)", 1, 0); 300 if(flag == 1) 301 { 302 struct sat* node = getsatbyorbitalpos(param); 303 if(node != NULL) 304 { 305 tmpstr = ostrcat(tmpstr, "(SAT)-", 1, 0); 306 tmpstr = ostrcat(tmpstr, node->name, 1, 0); 307 tmpstr1 = htmlencode(tmpstr); 308 free(tmpstr); tmpstr = NULL; 309 } 310 } 311 if(flag == 2) 312 { 313 struct provider* node = getprovider(param); 314 if(node != NULL) 315 { 316 tmpstr = ostrcat(tmpstr, "(PROVIDER)-", 1, 0); 317 tmpstr = ostrcat(tmpstr, node->name, 1, 0); 318 tmpstr1 = htmlencode(tmpstr); 319 free(tmpstr); tmpstr = NULL; 320 } 321 } 322 if(flag == 3) 323 { 324 tmpstr = malloc(2); 325 if(tmpstr != NULL) 326 snprintf(tmpstr, 2, "%c", param); 327 tmpstr = ostrcat("(A-Z)-", tmpstr, 0, 1); 328 tmpstr1 = htmlencode(tmpstr); 329 free(tmpstr); tmpstr = NULL; 330 } 331 293 332 while(chnode != NULL) 294 333 { … … 325 364 continue; 326 365 } 327 webcreatechannelbody(&buf, line, chnode, &maxlen, &pos, 0);366 webcreatechannelbody(&buf, line, chnode, tmpstr1, &maxlen, &pos, 0); 328 367 329 368 if(line == 0) … … 334 373 chnode = chnode->next; 335 374 } 375 free(tmpstr); tmpstr = NULL; 336 376 337 377 if(maxcount > MAXHTMLLINE) … … 624 664 625 665 webcreateheadbig(&buf, &maxlen, NULL, &pos, 1); 626 webcreatechannelbody(&buf, line, chnode, &maxlen, &pos ,1);666 webcreatechannelbody(&buf, line, chnode, getconfig("channellist", NULL), &maxlen, &pos ,1); 627 667 webcreatetailbig(&buf, &maxlen, &pos, 1); 628 668 … … 633 673 { 634 674 int ret = 0; 635 char* param1 = NULL ;675 char* param1 = NULL, *param2 = NULL; 636 676 struct channel* chnode = NULL; 637 677 … … 641 681 param1 = strchr(param, '&'); 642 682 if(param1 != NULL) 683 { 643 684 *param1++ = '\0'; 685 param2 = strchr(param1, '&'); 686 if(param2 != NULL) 687 *param2++ = '\0'; 688 } 644 689 645 690 if(param1 == NULL) return NULL; … … 651 696 if(ret == 0) 652 697 ret = servicestart(chnode, NULL, 0); 698 { 699 if(param2 != NULL && ret != 20 && ret != 21 && ret != 22) 700 addconfig("channellist", param2); 701 } 653 702 } 654 703
Note: See TracChangeset
for help on using the changeset viewer.