]> git.webhop.me Git - tuxwetter.git/commitdiff
use curl for localhost
authorFlatTV <FlatTV@gmx.de>
Wed, 15 Aug 2012 09:50:51 +0000 (11:50 +0200)
committersatbaby <satbaby>
Wed, 15 Aug 2012 11:53:10 +0000 (13:53 +0200)
build.sh
http.c
parser.c
tuxwetter.c

index 023da094c5af2214d77bfe7a3e126d54a576ca7d..df7b811f6cfcab8010dbbf7f694d00aa18c1f6f6 100644 (file)
--- a/build.sh
+++ b/build.sh
@@ -1 +1 @@
-arm-cx2450x-linux-gnueabi-gcc -g -o tuxwetter tuxwetter.c gfx.c io.c text.c parser.c php.c http.c jpeg.c fb_display.c resize.c pngw.c gif.c -L$PREFIX/lib -I$PREFIX/include -I$PREFIX/include/freetype2 -I$PREFIX/include/freetype2 -O2 -lfreetype -lz -ljpeg  -lpng -lungif gifdecomp.c
+arm-cx2450x-linux-gnueabi-gcc -g -o tuxwetter tuxwetter.c gfx.c io.c text.c parser.c php.c http.c jpeg.c fb_display.c resize.c pngw.c gif.c -L$PREFIX/lib -I$PREFIX/include -I$PREFIX/include/freetype2 -O2 -lfreetype -lz -ljpeg  -lpng -lgif -DWWEATHER gifdecomp.c
diff --git a/http.c b/http.c
index 32197fc841bb9fffbfc87b4307615ab771eead05..a3334892c366dc36ace2310d97f2ff71398f11c0 100644 (file)
--- a/http.c
+++ b/http.c
@@ -55,8 +55,10 @@ int HTTP_downloadFile(char *URL, char *downloadTarget, int showprogress, int tmo
 {
        CURL *curl;
        CURLcode res=-1;
-       char *pt1,*pt2,*pt3=NULL,*tstr=NULL,*surl=URL,myself[25];
-       FILE *headerfile,*netfile;
+       //char *pt1,*pt2,*pt3=NULL,myself[25];
+       char *tstr=NULL,*surl=URL;
+       FILE *headerfile;
+       //FILE *netfile;
        int i=strlen(URL),y;
 
        for(y=0; y<4; y++) // change HTTP to lower case
@@ -76,7 +78,7 @@ int HTTP_downloadFile(char *URL, char *downloadTarget, int showprogress, int tmo
        curl = curl_easy_init();
        if(curl)
        {
-               pt1=strstr(URL,"localhost");
+/*             pt1=strstr(URL,"localhost");
                if(!pt1)
                {
                        pt1=strstr(URL,"127.0.0.1");
@@ -110,7 +112,7 @@ int HTTP_downloadFile(char *URL, char *downloadTarget, int showprogress, int tmo
                                }
                        }
                }
-               speed=tmo;
+*/             speed=tmo;
                while(res && repeats--)
                {
                        curl_easy_setopt(curl, CURLOPT_URL, surl);
@@ -123,6 +125,7 @@ int HTTP_downloadFile(char *URL, char *downloadTarget, int showprogress, int tmo
                        curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, (ctimo)?ctimo:(30+tmo*45));
                        curl_easy_setopt(curl, CURLOPT_TIMEOUT, (tmo+1)*60);
                        curl_easy_setopt(curl, CURLOPT_FAILONERROR, 0);
+                       curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);
                        if(proxyadress && strstr(URL,"//127.0.0.1/")==NULL && strstr(URL,"//localhost/")==NULL)
                        {
                                curl_easy_setopt(curl, CURLOPT_PROXY, proxyadress);
index cb9b938b812923adb494f419fb1c69f0b5b4fa84..7bfe681afc6bc054ec83fa8cf27c0df6ccf33787 100644 (file)
--- a/parser.c
+++ b/parser.c
@@ -373,6 +373,7 @@ int parser(char *citycode, char *trans, int metric, int inet, int ctmo)
                                                data[bc][cc] = toupper(gettemp);
                                        else
                                                data[bc][cc] = gettemp;
+                                       //printf("#2 data[%d][%d] = %c(%d)\n",bc,cc,gettemp,gettemp);
                                        cc++;
                                        d_flag=1;
                                        if(cc == MAXMEM-1) rec = 0;
@@ -386,6 +387,7 @@ int parser(char *citycode, char *trans, int metric, int inet, int ctmo)
                                if ((gettemp == '<' || gettemp == ']') && d_flag)
                                {
                                        data[bc][cc] = '\0';
+                                       //printf("data[%d] = %s\n",bc,data[bc]);
                                        bc++;
                                        cc = 0;
                                        rec = 0;
index 19a390b985c5498da9b83b2efd2a450cf718d48f..7f21e75bc663cd100d6967cb18987613a2b50ab9 100644 (file)
@@ -44,7 +44,7 @@
 #include "resize.h"
 #include "gifdecomp.h"
 
-#define P_VERSION "3.03"
+#define P_VERSION "3.04"
 
 #ifndef HAVE_DREAMBOX_HARDWARE
 char CONVERT_LIST[]="/var/tuxbox/config/tuxwetter/convert.list";
@@ -1229,7 +1229,7 @@ time_t atime;
 struct tm *sltime;
 char tun[2]="C",sun[5]="km/h",dun[3]="km",pun[5]="mbar",cun[20];
 
-       if(var_screeninfo.xres < 800)
+       if (var_screeninfo.xres < 1280)
                slim=1;
 
        clear_screen();