Changeset 30097
- Timestamp:
- 09/24/14 20:57:08 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
titan/titan/httpd.h
r30084 r30097 611 611 fullfilename = ostrcat(filename, NULL, 0, 0); 612 612 else 613 { 613 614 fullfilename = ostrcat(getconfig("httpdpath", NULL), filename, 0, 0); 615 616 if(ostrstr(filename, ".html") != NULL) 617 { 618 debug(250, "filename: %s", filename); 619 debug(250, "fullfilename: %s", fullfilename); 620 621 char* tmphtml = readfiletomem(fullfilename, 0); 622 623 debug(250, "#### tmphtml1 ##################################"); 624 debug(250, "tmphtml1: %s", buf); 625 626 while(ostrstr(tmphtml, "_\(\"") != NULL) 627 { 628 char* tmpstr1 = string_resub("_(\"", "\")", tmphtml, 0); 629 char* tmpstr2 = ostrcat("_(\"", tmpstr1, 0, 0); 630 tmpstr2 = ostrcat(tmpstr2, "\")", 1, 0); 631 632 debug(250, "--------------------------------------"); 633 debug(250, "Search string: %s", tmpstr2); 634 debug(250, "Replace string: %s", tmpstr1); 635 debug(250, "Replace %s -> %s", tmpstr2, tmpstr1); 636 debug(250, "--------------------------------------"); 637 638 tmphtml = string_replace_all(tmpstr2, _(tmpstr1), tmphtml, 1); 639 free(tmpstr1), tmpstr1 = NULL; 640 free(tmpstr2), tmpstr2 = NULL; 641 } 642 debug(250, "#### tmphtml2 ##################################"); 643 debug(250, "tmphtml2: %s", tmphtml); 644 645 free(fullfilename), fullfilename = NULL; 646 fullfilename = ostrcat("/tmp/.", filename, 0, 0); 647 writesys(fullfilename, tmphtml, 0); 648 } 649 } 650 614 651 filefd = open(fullfilename, O_RDONLY | O_LARGEFILE); 615 652 if(filefd < 0) … … 641 678 } 642 679 643 int translate = 0;644 if(ostrstr(filename, ".html") != NULL)645 {646 translate = 1;647 debug(250, "#### buf1 ##################################");648 debug(250, "filename: %s", filename);649 debug(250, "fullfilename: %s/%s", getconfig("httpdpath", NULL), filename);650 debug(250, "buf1: %s", buf);651 }652 653 680 //TODO: 654 681 int readret = 1; … … 656 683 { 657 684 readret = dvbreadfd(filefd, buf, 0, MINMALLOC, 1000, 0); 658 if(translate == 1) 659 { 660 debug(250, "#### buf2 ##################################"); 661 debug(250, "buf2: %s", buf); 662 } 663 if(translate == 1) 664 { 665 while(ostrstr(buf, "_\(\"") != NULL) 666 { 667 char* tmpstr1 = string_resub("_(\"", "\")", buf, 0); 668 char* tmpstr2 = ostrcat("_(\"", tmpstr1, 0, 0); 669 tmpstr2 = ostrcat(tmpstr2, "\")", 1, 0); 670 671 debug(250, "--------------------------------------"); 672 debug(250, "Search string: %s", tmpstr2); 673 debug(250, "Replace string: %s", tmpstr1); 674 debug(250, "Replace %s -> %s", tmpstr2, tmpstr1); 675 debug(250, "--------------------------------------"); 676 677 buf = string_replace_all(tmpstr2, _(tmpstr1), buf, 1); 678 free(tmpstr1), tmpstr1 = NULL; 679 free(tmpstr2), tmpstr2 = NULL; 680 } 681 debug(250, "#### buf3 ##################################"); 682 debug(250, "buf3: %s", buf); 683 } 685 684 686 if(readret > 0) 685 687 socksend(connfd, buf, readret, 5000 * 1000); 686 687 688 } 688 689 }
Note: See TracChangeset
for help on using the changeset viewer.