зеркало из https://github.com/mozilla/pjs.git
Control the autoupdate via rdf. Changes from raman. Reviewed by rjc
This commit is contained in:
Родитель
ce1dbc6f08
Коммит
88fcb3ee2b
|
@ -24,7 +24,7 @@ MODULE = rdf
|
|||
LIBRARY_NAME = $(LITE_PREFIX)rdf
|
||||
LIBXP = $(DIST)/lib/libxp.$(LIB_SUFFIX)
|
||||
|
||||
REQUIRES = nspr dbm java js htmldlgs util img layer pref ldap
|
||||
REQUIRES = nspr dbm java js htmldlgs util img layer pref ldap network
|
||||
|
||||
JNI_GEN = netscape.rdf.core.NativeRDF netscape.rdf.core.NativeRDFEnumeration
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ MODULE = rdf
|
|||
LIBRARY_NAME = $(LITE_PREFIX)rdf
|
||||
LIBXP = $(DIST)/lib/libxp.$(LIB_SUFFIX)
|
||||
|
||||
REQUIRES = nspr dbm java js htmldlgs util img layer pref ldap
|
||||
REQUIRES = nspr dbm java js htmldlgs util img layer pref ldap network
|
||||
|
||||
JNI_GEN = netscape.rdf.core.NativeRDF netscape.rdf.core.NativeRDFEnumeration
|
||||
|
||||
|
|
|
@ -34,12 +34,14 @@
|
|||
#include "es2mcf.h"
|
||||
#include "mcff2mcf.h"
|
||||
#include "nlcstore.h"
|
||||
#include "autoupdt.h"
|
||||
#include "ht.h"
|
||||
|
||||
|
||||
/* external routines */
|
||||
extern MWContext *FE_GetRDFContext(void);
|
||||
extern char *gDefaultNavcntr;
|
||||
extern RDF gNCDB;
|
||||
|
||||
|
||||
/* globals */
|
||||
|
@ -64,8 +66,34 @@ void
|
|||
rdf_complete(NET_StreamClass *stream)
|
||||
{
|
||||
RDFFile f = (RDFFile)stream->data_object;
|
||||
if ((f->resourceCount == 0) && (strcmp(f->url, gNavCntrUrl) == 0)) {
|
||||
if (strcmp(f->url, gNavCntrUrl) == 0) {
|
||||
if (f->resourceCount == 0) {
|
||||
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) {
|
||||
checkForAutoUpdate((void *)FE_GetRDFContext(),
|
||||
uf,
|
||||
fSize, /* File size */
|
||||
3000, /* byte range */
|
||||
10000 /* Interval in msecs */
|
||||
);
|
||||
freeMem(uf);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (f) {
|
||||
freeMem(f->line);
|
||||
|
|
|
@ -87,7 +87,8 @@ LINCS=-I$(XPDIST)\public\nspr -I$(XPDIST)\public\dbm \
|
|||
-I$(XPDIST)\public\htmldlgs -I$(XPDIST)\public\util \
|
||||
-I$(XPDIST)\public\img -I$(XPDIST)\public\layer \
|
||||
-I$(XPDIST)\public\ldap \
|
||||
-I$(XPDIST)\public\pref
|
||||
-I$(XPDIST)\public\pref \
|
||||
-I$(XPDIST)\public\network
|
||||
|
||||
!endif
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче