зеркало из https://github.com/mozilla/gecko-dev.git
Added some more preferences for AutoUpdate
This commit is contained in:
Родитель
e06f33e5d3
Коммит
f49eb6d2b2
|
@ -310,8 +310,8 @@ BASIC_LIBS = \
|
|||
$(DIST)/lib/libjsurl.a \
|
||||
$(DIST)/lib/libmarimurl.a \
|
||||
$(DIST)/lib/libremoturl.a \
|
||||
$(DIST)/lib/libnetwork.a \
|
||||
$(DIST)/lib/lib$(LITE_PREFIX)rdf.a \
|
||||
$(DIST)/lib/libnetwork.a \
|
||||
$(DIST)/lib/lib$(LITE_PREFIX)xml.a \
|
||||
$(DIST)/lib/lib$(LITE_PREFIX)lay.a \
|
||||
$(DIST)/lib/libpng.a \
|
||||
|
|
|
@ -315,8 +315,8 @@ BASIC_LIBS = \
|
|||
$(DIST)/lib/libjsurl.a \
|
||||
$(DIST)/lib/libmarimurl.a \
|
||||
$(DIST)/lib/libremoturl.a \
|
||||
$(DIST)/lib/libnetwork.a \
|
||||
$(DIST)/lib/lib$(LITE_PREFIX)rdf.a \
|
||||
$(DIST)/lib/libnetwork.a \
|
||||
$(DIST)/lib/lib$(LITE_PREFIX)xml.a \
|
||||
$(DIST)/lib/lib$(LITE_PREFIX)lay.a \
|
||||
$(DIST)/lib/libmariner.a \
|
||||
|
|
|
@ -230,6 +230,8 @@ pref("autoupdate.enabled", true);
|
|||
pref("autoupdate.confirm_install", false);
|
||||
pref("autoupdate.background_download_enabled", false);
|
||||
pref("autoupdate.background_download_directory", "");
|
||||
pref("autoupdate.background_download_byte_range", 3000);
|
||||
pref("autoupdate.background_download_interval", 10000);
|
||||
|
||||
pref("imap.io.mac.logging", false);
|
||||
|
||||
|
|
|
@ -68,33 +68,28 @@ rdf_complete(NET_StreamClass *stream)
|
|||
RDFFile f = (RDFFile)stream->data_object;
|
||||
if (strcmp(f->url, gNavCntrUrl) == 0) {
|
||||
if (f->resourceCount == 0) {
|
||||
parseNextRDFXMLBlob(stream, gDefaultNavcntr, strlen(gDefaultNavcntr));
|
||||
parseNextRDFXMLBlob(stream, gDefaultNavcntr, strlen(gDefaultNavcntr));
|
||||
} else {
|
||||
RDF_Resource browser = RDF_GetResource(NULL, "netscape:browser", 1);
|
||||
RDF_Resource updateFrom = RDF_GetResource(NULL, "updateURL", 1);
|
||||
char* uf = RDF_GetSlotValue(gNCDB, browser, updateFrom,
|
||||
RDF_STRING_TYPE, false, true);
|
||||
RDF_Resource fileSize = RDF_GetResource(NULL, "fileSize", 1);
|
||||
char* fs = RDF_GetSlotValue(gNCDB, browser, fileSize,
|
||||
RDF_STRING_TYPE, false, true);
|
||||
uint32 fSize;
|
||||
if (fs == NULL) {
|
||||
fSize = 3000;
|
||||
} else {
|
||||
sscanf("%lu", fs, &fSize);
|
||||
freeMem(fs);
|
||||
}
|
||||
if (uf != NULL) {
|
||||
RDF_Resource browser = RDF_GetResource(NULL, "netscape:browser", 1);
|
||||
RDF_Resource updateFrom = RDF_GetResource(NULL, "updateURL", 1);
|
||||
char* uf = RDF_GetSlotValue(gNCDB, browser, updateFrom,
|
||||
RDF_STRING_TYPE, false, true);
|
||||
RDF_Resource fileSize = RDF_GetResource(NULL, "fileSize", 1);
|
||||
char* fs = RDF_GetSlotValue(gNCDB, browser, fileSize,
|
||||
RDF_STRING_TYPE, false, true);
|
||||
uint32 fSize;
|
||||
if (fs == NULL) {
|
||||
fSize = 3000;
|
||||
} else {
|
||||
sscanf("%lu", fs, &fSize);
|
||||
freeMem(fs);
|
||||
}
|
||||
if (uf != NULL) {
|
||||
#ifdef MOZ_SMARTUPDATE
|
||||
checkForAutoUpdate((void *)FE_GetRDFContext(),
|
||||
uf,
|
||||
fSize, /* File size */
|
||||
3000, /* byte range */
|
||||
10000 /* Interval in msecs */
|
||||
);
|
||||
checkForAutoUpdate((void *)FE_GetRDFContext(), uf, fSize);
|
||||
#endif
|
||||
freeMem(uf);
|
||||
}
|
||||
freeMem(uf);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (f) {
|
||||
|
|
|
@ -274,8 +274,10 @@ PR_PUBLIC_API(void)
|
|||
#else
|
||||
PUBLIC void
|
||||
#endif
|
||||
checkForAutoUpdate(void *cx, char* url, int32 file_size, int32 bytes_range, uint32 interval)
|
||||
checkForAutoUpdate(void *cx, char* url, int32 file_size)
|
||||
{
|
||||
int32 bytes_range;
|
||||
int32 interval;
|
||||
char *directory = NULL;
|
||||
#ifdef WIN32
|
||||
char Path[_MAX_PATH+1];
|
||||
|
@ -301,6 +303,15 @@ checkForAutoUpdate(void *cx, char* url, int32 file_size, int32 bytes_range, uint
|
|||
}
|
||||
}
|
||||
|
||||
if (PREF_OK != PREF_GetIntPref("autoupdate.background_download_byte_range",
|
||||
&bytes_range)) {
|
||||
bytes_range = 3000;
|
||||
}
|
||||
|
||||
if (PREF_OK != PREF_GetIntPref("autoupdate.background_download_interval",
|
||||
&interval)) {
|
||||
interval = 10000;
|
||||
}
|
||||
|
||||
autoupdt = PR_Malloc(sizeof(AutoUpdateConnnectionStruct));
|
||||
memset(autoupdt, '\0', sizeof(AutoUpdateConnnectionStruct));
|
||||
|
|
|
@ -102,7 +102,7 @@ PR_PUBLIC_API(void)
|
|||
#else
|
||||
PUBLIC void
|
||||
#endif
|
||||
checkForAutoUpdate(void *cx, char* url, int32 file_size, int32 bytes_range, uint32 interval);
|
||||
checkForAutoUpdate(void *cx, char* url, int32 file_size);
|
||||
|
||||
PR_END_EXTERN_C
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче