Changeset 19884


Ignore:
Timestamp:
02/01/13 19:29:09 (11 years ago)
Author:
obi
Message:

[titan] update download stuff step1

Location:
titan
Files:
25 edited

Legend:

Unmodified
Added
Removed
  • titan/plugins/facebook/facebook.h

    r17482 r19884  
    9090        }
    9191
    92         gethttp(ip, path, 80, name, NULL, NULL, 0);
     92        gethttp(ip, path, 80, name, NULL, 5000, NULL, 0);
    9393
    9494        return 0;
  • titan/plugins/gmediarender/gmediarender.h

    r19038 r19884  
    4343                free(cmd), cmd = NULL;
    4444*/
    45                 gethttp(tmpip, path, port, "/tmp/gmediarenderpic.jpg", NULL, NULL, 0);
     45                gethttp(tmpip, path, port, "/tmp/gmediarenderpic.jpg", NULL, 5000, NULL, 0);
    4646                changepic(gmediarender, "/tmp/gmediarenderpic.jpg");
    4747                drawscreen(gmediarender, 0, 0);
     
    5959                free(cmd), cmd = NULL;
    6060*/
    61                 gethttp(tmpip, path, port, "/tmp/gmediarenderpic.png", NULL, NULL, 0);
     61                gethttp(tmpip, path, port, "/tmp/gmediarenderpic.png", NULL, 5000, NULL, 0);
    6262                changepic(gmediarender, "/tmp/gmediarenderpic.png");
    6363                drawscreen(gmediarender, 0, 0);
  • titan/plugins/imdb/imdb.h

    r19304 r19884  
    6666        debug(133, "search: http://www.imdb.de/%s", tmpsearch);
    6767
    68         tmpstr = gethttp("www.imdb.de", tmpsearch, 80, NULL, NULL, NULL, 0);
     68        tmpstr = gethttp("www.imdb.de", tmpsearch, 80, NULL, NULL, 5000, NULL, 0);
    6969       
    7070        debug(133, "tmpsearch: %s", tmpsearch);
     
    212212                        tmpsearch = ostrcat(tmpsearch, (*first)->id, 1, 0);
    213213       
    214                         tmpstr = gethttp("www.imdb.de", tmpsearch, 80, NULL, NULL, NULL, 0);
     214                        tmpstr = gethttp("www.imdb.de", tmpsearch, 80, NULL, NULL, 5000, NULL, 0);
    215215                       
    216216                        debug(133, "tmpsearch: %s", tmpsearch);
     
    322322                tmpsearch = ostrcat(tmpsearch, "/", 1, 0);
    323323       
    324                 tmpstr = gethttp("www.imdb.de", tmpsearch, 80, NULL, NULL, NULL, 0);
     324                tmpstr = gethttp("www.imdb.de", tmpsearch, 80, NULL, NULL, 5000, NULL, 0);
    325325               
    326326                debug(133, "tmpsearch: %s", tmpsearch);
     
    344344                tmpsearch = ostrcat(tmpsearch, "/plotsummary", 1, 0);
    345345
    346                 tmpstr = gethttp("www.imdb.de", tmpsearch, 80, NULL, NULL, NULL, 0);
     346                tmpstr = gethttp("www.imdb.de", tmpsearch, 80, NULL, NULL, 5000, NULL, 0);
    347347               
    348348                debug(133, "tmpsearch: %s", tmpsearch);
     
    384384                                savefile = ostrcat(savefile, (*first)->id, 1, 0);
    385385                                savefile = ostrcat(savefile, "_poster.jpg", 1, 0);
    386                                 gethttp(ip, path, 80, savefile, NULL, NULL, 0);
     386                                gethttp(ip, path, 80, savefile, NULL, 5000, NULL, 0);
    387387                                free((*first)->poster);
    388388                                (*first)->poster = savefile;
     
    390390                        else
    391391                        {
    392                                 gethttp(ip, path, 80, TMPIMDBPIC1, NULL, NULL, 0);
     392                                gethttp(ip, path, 80, TMPIMDBPIC1, NULL, 5000, NULL, 0);
    393393                                free((*first)->poster);
    394394                                (*first)->poster = ostrcat(TMPIMDBPIC1, NULL, 0, 0);
     
    416416                                savefile = ostrcat(savefile, (*first)->id, 1, 0);
    417417                                savefile = ostrcat(savefile, "_thumb.jpg", 1, 0);
    418                                 gethttp(ip, path, 80, savefile, NULL, NULL, 0);
     418                                gethttp(ip, path, 80, savefile, NULL, 5000, NULL, 0);
    419419                                free((*first)->thumb);
    420420                                (*first)->thumb = savefile;
     
    422422                        else
    423423                        {
    424                                 gethttp(ip, path, 80, TMPIMDBPIC2, NULL, NULL, 0);
     424                                gethttp(ip, path, 80, TMPIMDBPIC2, NULL, 5000, NULL, 0);
    425425                                free((*first)->thumb);
    426426                                (*first)->thumb = ostrcat(TMPIMDBPIC2, NULL, 0, 0);
  • titan/plugins/imdbapi/imdbapi.h

    r19304 r19884  
    6161        debug(133, "search: http://www.imdbapi.com/%s", tmpsearch);
    6262
    63         tmpstr = gethttp("www.imdbapi.com", tmpsearch, 80, NULL, NULL, NULL, 0);
     63        tmpstr = gethttp("www.imdbapi.com", tmpsearch, 80, NULL, NULL, 5000, NULL, 0);
    6464        debug(133, "tmpsearch: %s", tmpsearch);
    6565//      debug(133, "tmpstr: %s", tmpstr);
     
    121121
    122122                                if(!file_exist(savefile))
    123                                         gethttp(ip, path, 80, savefile, NULL, NULL, 0);
     123                                        gethttp(ip, path, 80, savefile, NULL, 5000, NULL, 0);
    124124                                free((*first)->poster);
    125125                                (*first)->poster = savefile;
     
    153153                        else if(flag == 0)
    154154                        {
    155                                 gethttp(ip, path, 80, TMPIMDBAPIPIC, NULL, NULL, 0);
     155                                gethttp(ip, path, 80, TMPIMDBAPIPIC, NULL, 5000, NULL, 0);
    156156                                free((*first)->poster);
    157157                                (*first)->poster = ostrcat(TMPIMDBAPIPIC, NULL, 0, 0);
  • titan/plugins/lcdpearl1/lcd_weather.h

    r19708 r19884  
    7979//      tmpsearch = stringreplacechar(tmpsearch, ' ', '+');
    8080
    81         tmpstr = gethttp("weather.service.msn.com", tmpsearch, 80, NULL, NULL, NULL, 0);
     81        tmpstr = gethttp("weather.service.msn.com", tmpsearch, 80, NULL, NULL, 5000, NULL, 0);
    8282
    8383        free(tmpsearch); tmpsearch = NULL;
  • titan/plugins/lcdsamsung/lcd_weather.h

    r19150 r19884  
    7979//      tmpsearch = stringreplacechar(tmpsearch, ' ', '+');
    8080
    81         tmpstr = gethttp("weather.service.msn.com", tmpsearch, 80, NULL, NULL, NULL, 0);
     81        tmpstr = gethttp("weather.service.msn.com", tmpsearch, 80, NULL, NULL, 5000, NULL, 0);
    8282
    8383        free(tmpsearch); tmpsearch = NULL;
  • titan/plugins/news/news.h

    r19468 r19884  
    123123
    124124        //TODO: got language from titan.cfg
    125         tmpstr = gethttp("www.google.com", "ig/api?news&hl=de", 80, NULL, NULL, NULL, 0);
     125        tmpstr = gethttp("www.google.com", "ig/api?news&hl=de", 80, NULL, NULL, 5000, NULL, 0);
    126126
    127127        if(tmpstr != NULL)
  • titan/plugins/stock/stock.h

    r19468 r19884  
    119119        tmpsearch = stringreplacechar(tmpsearch, ' ', '+');
    120120
    121         tmpstr = gethttp("www.google.com", tmpsearch, 80, NULL, NULL, NULL, 0);
     121        tmpstr = gethttp("www.google.com", tmpsearch, 80, NULL, NULL, 5000, NULL, 0);
    122122
    123123        free(tmpsearch); tmpsearch = NULL;
  • titan/plugins/tithek/beeg.h

    r19879 r19884  
    1717        }
    1818
    19         tmpstr = gethttp(ip, path, 80, NULL, NULL, NULL, 0);
     19        tmpstr = gethttp(ip, path, 80, NULL, NULL, 10000, NULL, 0);
    2020        if(getconfigint("debuglevel", NULL) == 99)
    2121                writesys("/tmp/beeg1_tmpstr", tmpstr, 0);
  • titan/plugins/tithek/filenuke.h

    r19879 r19884  
    3434        debug(99, "test host only: %s", get_ip(host));
    3535        debug(99, "tmpfile: %s", tmpfile);
    36         tmpstr = gethttp(tmphost, tmpfile, 80, NULL, NULL, NULL, 0);
     36        tmpstr = gethttp(tmphost, tmpfile, 80, NULL, NULL, 10000, NULL, 0);
    3737        debug(99, "write file");
    3838        sleep(2);
  • titan/plugins/tithek/kinox.h

    r19658 r19884  
    7979                path = ostrcat("Search.html?q=", search, 0, 0);
    8080       
    81                 tmpstr = gethttp(ip, path, 80, NULL, NULL, NULL, 0);
     81                tmpstr = gethttp(ip, path, 80, NULL, NULL, 10000, NULL, 0);
    8282                tmpstr = string_resub("<div id=\"beep\" class=\"beep\"></div>", "</table>", tmpstr, 0);
    8383
     
    111111                                                lang = ostrcat(lang, " (\?\?)", 1, 0);
    112112                                                                                                                                       
    113                                         tmpstr1 = gethttp("kinox.to", path, 80, NULL, NULL, NULL, 0);
     113                                        tmpstr1 = gethttp("kinox.to", path, 80, NULL, NULL, 10000, NULL, 0);
    114114
    115115                                        from = ostrcat("<div class=\"Grahpics\"><a href=\"", path, 0, 0);
     
    195195        }
    196196
    197         tmpstr = gethttp(ip, path, 80, NULL, NULL, NULL, 0);
     197        tmpstr = gethttp(ip, path, 80, NULL, NULL, 10000, NULL, 0);
    198198       
    199199        if(tmpstr != NULL)
     
    294294                                        pathnew = ostrcat("/aGET/Mirror/", hlink, 0, 0);
    295295       
    296                                         tmpstr1 = gethttp("kinox.to", pathnew, 80, NULL, NULL, NULL, 0);
     296                                        tmpstr1 = gethttp("kinox.to", pathnew, 80, NULL, NULL, 10000, NULL, 0);
    297297                                        free(pathnew), pathnew = NULL;
    298298       
     
    460460        }
    461461
    462         tmpstr = gethttp(ip, path, 80, NULL, NULL, NULL, 0);
     462        tmpstr = gethttp(ip, path, 80, NULL, NULL, 10000, NULL, 0);
    463463
    464464        if(tmpstr != NULL)
     
    479479       
    480480                free(tmpstr), tmpstr = NULL;
    481                 tmpstr = gethttp("kinox.to", pathnew, 80, NULL, NULL, NULL, 0);
     481                tmpstr = gethttp("kinox.to", pathnew, 80, NULL, NULL, 10000, NULL, 0);
    482482                free(pathnew), pathnew = NULL;
    483483       
     
    512512                                        debug(99, "pathnew: %s", pathnew);
    513513       
    514                                         tmpstr1 = gethttp("kinox.to", pathnew, 80, NULL, NULL, NULL, 0);
     514                                        tmpstr1 = gethttp("kinox.to", pathnew, 80, NULL, NULL, 10000, NULL, 0);
    515515                                        tmpstr1 = string_replace_all("\\", "", tmpstr1, 1);
    516516                                        tmpstr1 = string_resub("<a href=\"", "\"", tmpstr1, 0);
  • titan/plugins/tithek/myvideo.h

    r19535 r19884  
    3636        char* tmpstr = NULL;
    3737// not working tmpstr hat zusatzdaten im string
    38         tmpstr = gethttp(ip, path, 80, NULL, NULL, NULL, 0);
     38        tmpstr = gethttp(ip, path, 80, NULL, NULL, 10000, NULL, 0);
    3939/*
    4040// work start
     
    165165                char* path = ostrcat("Videos_A-Z?searchWord=", search, 0, 0);
    166166                                       
    167                 char* tmpstr = gethttp(ip, path, 80, NULL, NULL, NULL, 0);
     167                char* tmpstr = gethttp(ip, path, 80, NULL, NULL, 10000, NULL, 0);
    168168                tmpstr = string_replace_all("<", "\n", tmpstr, 1);
    169169                tmpstr = string_replace_all(">", "\n", tmpstr, 1);
  • titan/plugins/tithek/rtl2now.h

    r18053 r19884  
    2121
    2222        char* tmpstr = NULL;
    23         tmpstr = gethttp(ip, path, 80, NULL, NULL, NULL, 0);
     23        tmpstr = gethttp(ip, path, 80, NULL, NULL, 10000, NULL, 0);
    2424               
    2525        if(flag == 1)
  • titan/plugins/tithek/tithek.h

    r19879 r19884  
    145145                {
    146146                        free(tmp); tmp = NULL;
    147                         tmp = gethttp(cmd, "/", 80, NULL, NULL, NULL, 0);
     147                        tmp = gethttp(cmd, "/", 80, NULL, NULL, 10000, NULL, 0);
    148148                        if(tmp != NULL) break;
    149149                }
     
    356356                {
    357357                        free(tmp); tmp = NULL;
    358                         tmp = gethttp(cmd, "/", 80, NULL, NULL, NULL, 0);
     358                        tmp = gethttp(cmd, "/", 80, NULL, NULL, 10000, NULL, 0);
    359359                        if(tmp != NULL) break;
    360360                }
     
    670670                m_unlock(&status.tithekmutex, 20);
    671671
    672                 gethttpreal(node->host, node->page, node->port, node->filename, node->auth, NULL, 0, NULL, NULL, 20000, 0);
     672                gethttpreal(node->host, node->page, node->port, node->filename, node->auth, NULL, 0, NULL, NULL, node->timeout, 0);
    673673
    674674                if(tithekrun == 0)
     
    714714char* tithekdownload(char* link, char* localname, char* pw, int pic, int flag)
    715715{
    716         int ret = 1, port = 80;
     716        int ret = 1, port = 80, timeout = 50000;
    717717        char* ip = NULL, *pos = NULL, *path = NULL;
    718718        char* tmpstr = NULL, *localfile = NULL;
     
    773773                        {
    774774                                if(tithekdownloadcount >= 24) //start max 24 threads
    775                                         gethttp(ip, path, port, localfile, pw, NULL, 0);
     775                                        gethttp(ip, path, port, localfile, pw, timeout, NULL, 0);
    776776                                else
    777777                                {
     
    787787                                                dnode->connfd = -1;
    788788                                                dnode->ret = -1;
     789                                                dnode->timeout = timeout;
    789790                                                addtimer(&tithekdownloadthread, START, 100, 1, (void*)dnode, NULL, NULL);
    790791                                        }
     
    792793                        }
    793794                        else
    794                                 gethttp(ip, path, port, localfile, pw, NULL, 0);                       
     795                                gethttp(ip, path, port, localfile, pw, timeout, NULL, 0);                       
    795796                }
    796797        }
     
    802803
    803804                if(localfile != NULL && ret == 1)
    804                         screendownload("Download", ip, path, port, localfile, pw, 0);
     805                        screendownload("Download", ip, path, port, localfile, pw, timeout, 0);
    805806        }
    806807
     
    10711072        dnode->connfd = -1;
    10721073        dnode->ret = -1;
     1074        dnode->timeout = 500000;
    10731075       
    10741076        addtimer(&gethttpstruct, START, 1000, 1, (void*)dnode, NULL, NULL);
  • titan/plugins/tithek/youtube.h

    r19794 r19884  
    1919        }
    2020
    21         tmpstr = gethttp(ip, path, 80, NULL, NULL, NULL, 0);
     21        tmpstr = gethttp(ip, path, 80, NULL, NULL, 10000, NULL, 0);
    2222        if(flag == 1)
    2323        {
     
    170170                        path = ostrcat(path, "&max-results=50", 1, 0);
    171171                                       
    172                 char* tmpstr = gethttp(ip, path, 80, NULL, NULL, NULL, 0);
     172                char* tmpstr = gethttp(ip, path, 80, NULL, NULL, 10000, NULL, 0);
    173173                tmpstr = string_replace_all("media:thumbnail", "\nthumbnail", tmpstr, 1);
    174174
     
    194194                                                ip = ostrcat("www.youtube.com", NULL, 0, 0);
    195195                                                path = ostrcat("watch?v=", id, 0, 0);
    196                                                 title = gethttp(ip, path, 80, NULL, NULL, NULL, 0);
     196                                                title = gethttp(ip, path, 80, NULL, NULL, 10000, NULL, 0);
    197197                                                title = string_resub("<meta name=\"title\" content=\"", "\">", title, 0);
    198198
  • titan/plugins/tmdb/tmdb.h

    r19859 r19884  
    154154                savefile = ostrcat(savefile, pic, 1, 0);
    155155                if(!file_exist(savefile))
    156                         gethttp(ip, path, 80, savefile, NULL, NULL, 0);
     156                        gethttp(ip, path, 80, savefile, NULL, 5000, NULL, 0);
    157157                ret = savefile;
    158158        }
    159159        else
    160160        {
    161                 gethttp(ip, path, 80, tmppic, NULL, NULL, 0);
     161                gethttp(ip, path, 80, tmppic, NULL, 5000, NULL, 0);
    162162                ret = ostrcat(tmppic, NULL, 0, 0);
    163163        }
     
    207207
    208208        debug(133, "search: http://api.themoviedb.org/%s", tmpsearch);
    209         tmpstr = gethttp("api.themoviedb.org", tmpsearch, 80, NULL, NULL, NULL, 0);
     209        tmpstr = gethttp("api.themoviedb.org", tmpsearch, 80, NULL, NULL, 5000, NULL, 0);
    210210       
    211211        debug(133, "tmpsearch: %s", tmpsearch);
  • titan/plugins/weather/weather.h

    r19468 r19884  
    140140        //tmpsearch = stringreplacechar(tmpsearch, ' ', '+');
    141141
    142         tmpstr = gethttp("weather.service.msn.com", tmpsearch, 80, NULL, NULL, NULL, 0);
    143         //tmpstr = gethttp("www.google.com", tmpsearch, 80, NULL, NULL, NULL, 0);
     142        tmpstr = gethttp("weather.service.msn.com", tmpsearch, 80, NULL, NULL, 5000, NULL, 0);
     143        //tmpstr = gethttp("www.google.com", tmpsearch, 80, NULL, NULL, 5000, NULL, 0);
    144144
    145145        free(tmpsearch); tmpsearch = NULL;
  • titan/titan/download.h

    r19553 r19884  
    22#define DOWNLOAD_H
    33
    4 int screendownload(char* title, char* host, char* page, int port, char* filename, char* auth, int flag)
     4int screendownload(char* title, char* host, char* page, int port, char* filename, char* auth, int timeout, int flag)
    55{
    66        debug(1000, "in");
     
    6060        dnode->connfd = -1;
    6161        dnode->ret = -1;
     62        dnode->timeout = timeout;
    6263       
    6364        addtimer(&gethttpstruct, START, 1000, 1, (void*)dnode, NULL, NULL);
  • titan/titan/global.h

    r19839 r19884  
    5656        {
    5757                free(tmp); tmp = NULL;
    58                 tmp = gethttp(cmd, "/", 80, NULL, NULL, NULL, 0);
     58                tmp = gethttp(cmd, "/", 80, NULL, NULL, 5000, NULL, 0);
    5959                if(tmp != NULL) break;
    6060        }
     
    10451045        {
    10461046                char* blackfile = NULL;
    1047                 blackfile = gethttp("atemio.dyndns.tv", "/svn/auth/blacklist", 80, NULL, HTTPAUTH, NULL, 0);
     1047                blackfile = gethttp("atemio.dyndns.tv", "/svn/auth/blacklist", 80, NULL, HTTPAUTH, 5000, NULL, 0);
    10481048       
    10491049                count = 0;
  • titan/titan/header.h

    r19843 r19884  
    165165
    166166//sock.h
    167 char* gethttp(char* host, char* page, int port, char* filename, char* auth, struct download* dnode, int redirect);
     167char* gethttp(char* host, char* page, int port, char* filename, char* auth, int timeout, struct download* dnode, int redirect);
    168168char *get_ip(char *host);
    169169int sockportopen(int *fd, char* ip, int port, int tout);
     
    292292
    293293//download.h
    294 int screendownload(char* title, char* host, char* page, int port, char* filename, char* auth, int flag);
     294int screendownload(char* title, char* host, char* page, int port, char* filename, char* auth, int timeout, int flag);
    295295
    296296// epgrecord.h
  • titan/titan/info.h

    r18617 r19884  
    7171                path = ostrcat(path, boxversion, 1, 0);
    7272                path = ostrcat(path, ".titan", 1, 0);
    73                 tmpstr = gethttp("atemio.dyndns.tv", path, 80, NULL, HTTPAUTH, NULL, 0);
     73                tmpstr = gethttp("atemio.dyndns.tv", path, 80, NULL, HTTPAUTH, 5000, NULL, 0);
    7474                free(path), path = NULL;
    7575                free(boxversion), boxversion = NULL;
     
    8484                char* out = NULL;
    8585                path = ostrcat(path, "/svn/image-beta/changelog.git", 1, 0);
    86                 tmpstr = gethttp("atemio.dyndns.tv", path, 80, NULL, HTTPAUTH, NULL, 0);
     86                tmpstr = gethttp("atemio.dyndns.tv", path, 80, NULL, HTTPAUTH, 5000, NULL, 0);
    8787                free(path), path = NULL;
    8888                out = readfromlinetoline(tmpstr, 0, 500, 1);
  • titan/titan/ipkg.h

    r17650 r19884  
    378378                        tmppath = ostrcat(tmppath, path, 1, 0);
    379379                        tmppath = string_replace("Packages.gz", "Packages.preview.tar.gz", tmppath, 1);
    380                         gethttp(ip, tmppath, 80, "/tmp/Packages.preview.tar.gz", HTTPAUTH, NULL, 0);
     380                        gethttp(ip, tmppath, 80, "/tmp/Packages.preview.tar.gz", HTTPAUTH, 5000, NULL, 0);
    381381                        free(tmppath); tmppath = NULL;
    382382                       
     
    387387
    388388                free(checkfile); checkfile = NULL;             
    389                 gethttp(ip, path, 80, (char*)filename, HTTPAUTH, NULL, 0);
     389                gethttp(ip, path, 80, (char*)filename, HTTPAUTH, 5000, NULL, 0);
    390390        }
    391391        else
  • titan/titan/newsletter.h

    r19495 r19884  
    9999
    100100        unlink(newsletterfile);
    101         gethttp("atemio.dyndns.tv", "/mediathek/newsletter.txt", 80, newsletterfile, HTTPAUTH, NULL, 0);
     101        gethttp("atemio.dyndns.tv", "/mediathek/newsletter.txt", 80, newsletterfile, HTTPAUTH, 5000, NULL, 0);
    102102
    103103        fileline = malloc(MINMALLOC);
  • titan/titan/sock.h

    r19839 r19884  
    781781}
    782782
    783 char* gethttp(char* host, char* page, int port, char* filename, char* auth, struct download* dnode, int redirect)
    784 {
    785         return gethttpreal(host, page, port, filename, auth, dnode, redirect, NULL, NULL, 5000, 0);
     783char* gethttp(char* host, char* page, int port, char* filename, char* auth, int timeout, struct download* dnode, int redirect)
     784{
     785        return gethttpreal(host, page, port, filename, auth, dnode, redirect, NULL, NULL, timeout, 0);
    786786}
    787787
     
    789789{
    790790        if(node != NULL)
    791                 gethttp(node->host, node->page, node->port, node->filename, node->auth, node, 0);
     791                gethttp(node->host, node->page, node->port, node->filename, node->auth, node->timeout, node, 0);
    792792}
    793793
  • titan/titan/struct.h

    r19869 r19884  
    553553        unsigned int aktkb;
    554554        int ret;
     555        int timeout;
    555556};
    556557
Note: See TracChangeset for help on using the changeset viewer.