Changeset 24235


Ignore:
Timestamp:
10/12/13 15:03:31 (9 years ago)
Author:
nit
Message:

[titan] tithek optimize

Location:
titan/plugins/tithek
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • titan/plugins/tithek/beeg.h

    r19884 r24235  
    55{
    66        debug(99, "link %s", link);
     7        int debuglevel = getconfigint("debuglevel", NULL);
    78        char* ip = NULL, *pos = NULL, *path = NULL, *streamurl = NULL, *tmpstr = NULL;
    89       
     
    1819
    1920        tmpstr = gethttp(ip, path, 80, NULL, NULL, 10000, NULL, 0);
    20         if(getconfigint("debuglevel", NULL) == 99)
    21                 writesys("/tmp/beeg1_tmpstr", tmpstr, 0);
     21        titheklog(debuglevel, "/tmp/beeg1_tmpstr", NULL, tmpstr);
    2222
    2323        if(tmpstr != NULL)
     
    2929        free(ip), ip = NULL;
    3030
    31         if(getconfigint("debuglevel", NULL) == 99)
    32                 writesys("/tmp/beeg2_streamurl", streamurl, 0);
     31  titheklog(debuglevel, "/tmp/beeg2_streamurl", NULL, streamurl);
    3332
    3433// segfault munmap_chunk(): invalid pointer
  • titan/plugins/tithek/filenuke.h

    r22199 r24235  
    55{
    66        debug(99, "in host: %s file: %s", host, file);
     7        int debuglevel = getconfigint("debuglevel", NULL);
    78        char* tmphost = NULL;
    89        char* tmpfile = NULL;
     
    3839        debug(99, "write file");
    3940        sleep(2);
    40         if(getconfigint("debuglevel", NULL) == 99)
    41                 writesys("/tmp/filenuke1_tmpstr", tmpstr, 0);
     41        titheklog(debuglevel, "/tmp/filenuke1_tmpstr", NULL, tmpstr);
    4242
    4343        if(ostrstr(tmpstr, "<title>The page is temporarily unavailable</title>") != NULL)
     
    9595        //send and receive answer
    9696        post = gethttpreal(tmphost, tmpfile, 80, NULL, NULL, NULL, 0, send, NULL, 5000, 0);
    97         if(getconfigint("debuglevel", NULL) == 99)
    98                 writesys("/tmp/filenuke2_tmpstr_post1", post, 0);
     97        titheklog(debuglevel, "/tmp/filenuke2_tmpstr_post1", NULL, post);
    9998//
    10099        gethttpreal(tmphost, tmpfile, 80, "/tmp/tithek/post", NULL, NULL, 0, send, NULL, 5000, 0);
     
    107106        free(tmpstr),tmpstr = NULL;
    108107        tmpstr = string_resub(";return p}('", ");'", post, 0);
    109         if(getconfigint("debuglevel", NULL) == 99)
    110                 writesys("/tmp/filenuke3_tmpstr1", tmpstr, 0);
     108        titheklog(debuglevel, "/tmp/filenuke3_tmpstr1", NULL, tmpstr);
    111109       
    112110        post = string_replace_all(tmpstr, "", post, 1);
    113111        post = string_replace_all(";return p}(');'", "", post, 1);
    114         if(getconfigint("debuglevel", NULL) == 99)
    115                 writesys("/tmp/filenuke4_post2", post, 0);
     112        titheklog(debuglevel, "/tmp/filenuke4_post2", NULL, post);
    116113
    117114        free(tmpstr),tmpstr = NULL;
    118115        free(b36code),b36code = NULL;
    119116        tmpstr = string_resub(";return p}('", ");'", post, 0);
    120         if(getconfigint("debuglevel", NULL) == 99)
    121                 writesys("/tmp/filenuke5_tmpstr2", tmpstr, 0);
     117        titheklog(debuglevel, "/tmp/filenuke5_tmpstr2", NULL, tmpstr);
    122118
    123119        b36code = oregex(".*;',[0-9]{2,2},[0-9]{2,2},'(.*)'.split.*", post);
    124120       
    125         b36code = string_replace_all("||", "| |", b36code, 1);         
    126         if(getconfigint("debuglevel", NULL) == 99)
    127                 writesys("/tmp/filenuke6_b36code2", b36code, 0);
     121        b36code = string_replace_all("||", "| |", b36code, 1);
     122        titheklog(debuglevel, "/tmp/filenuke6_b36code2", NULL, b36code);
    128123       
    129124        struct splitstr* ret1 = NULL;
     
    204199        free(charlist), charlist = NULL;
    205200
    206         if(getconfigint("debuglevel", NULL) == 99)
    207                 writesys("/tmp/filenuke7_tmpstr_last", tmpstr, 0);
     201  titheklog(debuglevel, "/tmp/filenuke7_tmpstr_last", NULL, tmpstr);
    208202
    209203        streamlink = oregex(".*file.*(http:.*video.flv).*image.*", tmpstr);
     
    235229                streamlink = oregex(".*value=.*(http:.*video.avi).*\".*", tmpstr);                     
    236230
    237         if(getconfigint("debuglevel", NULL) == 99)
    238                 writesys("/tmp/filenuke8_streamlink", streamlink, 0);
     231        titheklog(debuglevel, "/tmp/filenuke8_streamlink", NULL, streamlink);
    239232
    240233        free(tmpstr); tmpstr = NULL;
Note: See TracChangeset for help on using the changeset viewer.