Hi Diego, On Mon, Apr 10, 2006 at 08:23:33PM +0200, Diego Sáenz wrote:
Is it too late for a small hack?
Still time to squash bugs.
dl_gui is not localized, but wget yes. When you have a locale diferent from "C" or one english one dl_gui do not get the download size (it search for "Lenght:" in wget log) and progress bar do not show real progress.
How i unknown how portables are locale functions y use puntenv to change locale environ and set wget(and its log) to "C" A better solution can be to localize dl_gui or generalize wget parser
diff -pru dillo-0.8.6-rc4-C/dpi/downloads.cc dillo-0.8.6-rc4/dpi/downloads.cc --- dillo-0.8.6-rc4-C/dpi/downloads.cc 2006-04-10 19:47:00.000000000 +0200 +++ dillo-0.8.6-rc4/dpi/downloads.cc 2006-04-10 19:48:26.000000000 +0200 @@ -458,6 +458,8 @@ void DLItem::child_init() close(1); // stdout close(LogPipe[0]); dup2(LogPipe[1], 2); // stderr + // put locale to C (small hack) dl_gui search for "Lenght:" in wget log + putenv("LC_ALL=C"); // start wget execvp(dl_argv[0], dl_argv); }
I prefer setenv(), because with putenv() you have to define _XOPEN_SOURCE or _SVID_SOURCE.
If i get time i will try to support dillo cookies file. It is only add "--load-cookies $HOME/.dillo/cookies.txt" to wget comandline. May be this work (not tested, can anyone test and report?)
diff -pru dillo-0.8.6-rc4-C/dpi/downloads.cc dillo-0.8.6-rc4/dpi/downloads.cc --- dillo-0.8.6-rc4-C/dpi/downloads.cc 2006-04-10 20:20:30.000000000 +0200 +++ dillo-0.8.6-rc4/dpi/downloads.cc 2006-04-10 20:20:11.000000000 +0200 @@ -325,7 +325,7 @@ DLItem::DLItem(const char *full_filename /* avoid malicious SMTP relaying with FTP urls */ if (g_strncasecmp(esc_url, "ftp:/", 5) == 0) Filter_smtp_hack(esc_url); - dl_argv = new char*[6]; + dl_argv = new char*[7]; int i = 0; dl_argv[i++] = "wget"; if (action == DL_CONTINUE) { @@ -336,6 +336,7 @@ DLItem::DLItem(const char *full_filename dl_argv[i++] = "-O"; dl_argv[i++] = fullname; dl_argv[i++] = esc_url; //g_strdup_printf("'%s'", esc_url); + dl_argv[i++] = "--load-cookies $HOME/.dillo/cookies.txt"; dl_argv[i++] = NULL; //g_free(esc_url);
AFAIU that code will not work (setting two arguments in one place)...
But i do not understand this lines in DLItem::~DLItem()
if (dl_argv[4] == NULL) g_free(dl_argv[3]); else g_free(dl_argv[4]); delete(dl_argv);
¿do not change arguments order if "-c" is used or not?
Yes, but it's buggy! ;) All of it is fixed in my tree, but FLTK2 last version breaks lots of things so I'm going back for testing. :-P BTW, I have the idea of adding new downloads on top instead of bottom. That way you always see the fresh download you started, no matter what the size of the window. I'll test this with an older FLTK2 version and commit for your testing pleasure. ;) -- Cheers Jorge.-