X-Git-Url: https://git.jankratochvil.net/?a=blobdiff_plain;f=src%2Finstall%2Facquire%2Fmicrosoftcom.c;h=3b41a9dbc5ad18bf5c29e03611c02842329d3ca1;hb=bc148cbac3b6753db497f9c9390d601a25ccaa3b;hp=80abf67e70a535c10663a6f9ec3edd4712923c29;hpb=12dbdf39e0394c8939e9c2128478030b700cff25;p=captive.git diff --git a/src/install/acquire/microsoftcom.c b/src/install/acquire/microsoftcom.c index 80abf67..3b41a9d 100644 --- a/src/install/acquire/microsoftcom.c +++ b/src/install/acquire/microsoftcom.c @@ -33,43 +33,53 @@ /* Do we really need to use indirection by the following 'base' URL? * It appears to me as if some Microsoft Service Pack files URLs * have changed in the past. + * Currently we use fixed MICROSOFTDOWNLOAD_URL as we would have to + * implement custom Gnome-VFS http timeouts as 'ACQUIRE_CABINET_READ_RAW_READ_TIMEOUT'. */ -#define MICROSOFTCOM_URL "http://www.microsoft.com/WindowsXP/pro/downloads/servicepacks/sp1/checkedbuild.asp" +#if 0 +#define MICROSOFTCOM_URL "http://www.microsoft.com/downloads/details.aspx?familyid=7a4d8d12-9f5d-42bb-b31c-7b31657c869c" +#else +#define MICROSOFTDOWNLOAD_URL "http://download.microsoft.com/download/e/c/6/ec6e00ab-ec05-4673-b8db-0658cf65f043/WindowsXP-KB835935-SP2-DEBUG-ENU.exe" +#endif GList * /* of (GnomeVFSURI *) */ mod_uri_microsoftcom_list(void) { +#ifdef MICROSOFTCOM_URL int base_size; -char *base_contents; -char *href,*href_end; -const char *href2; +char *base_contents,*href_end; +#endif +char *href; GnomeVFSURI *uri; +#ifdef MICROSOFTCOM_URL base_contents=NULL; if (GNOME_VFS_OK!=gnome_vfs_read_entire_file(MICROSOFTCOM_URL,&base_size,&base_contents) || base_size<=0) { - g_warning(_("Cannot load file-URL pointing base URL: %s"),MICROSOFTCOM_URL); + g_warning(_("Cannot load base URL: %s"),MICROSOFTCOM_URL); goto fail_free_base_contents; } base_contents[base_size-1]=0; /* string terminator */ if (!(href=strstr(base_contents,"http://download.microsoft.com/")) || !(href_end=strchr(href,'"'))) { - g_warning(_("File-URL not found in base URL: %s"),MICROSOFTCOM_URL); + g_warning(_("Destination file URL not found in base URL: %s"),MICROSOFTCOM_URL); goto fail_free_base_contents; } *href_end=0; - if (strncmp(href,"http://",strlen("http://"))) { - g_warning(_("File URL not valid: %s"),href); - goto fail_free_base_contents; - } - href2=captive_printf_alloca("httpcaptive://%s",href+strlen("http://")); - if (!(uri=gnome_vfs_uri_new(href2))) { - g_warning(_("Found file URL not parsable: %s"),href2); +#else + href=MICROSOFTDOWNLOAD_URL; +#endif + if (!(uri=gnome_vfs_uri_new(href))) { + g_warning(_("Found destination file URL not parsable: %s"),href); goto fail_free_base_contents; } +#ifdef MICROSOFTCOM_URL g_free(base_contents); +#endif return g_list_append(NULL,uri); fail_free_base_contents: +#ifdef MICROSOFTCOM_URL g_free(base_contents); +#endif return NULL; }