Control the autoupdate via rdf. Changes from raman. Reviewed by rjc

git-svn-id: svn://10.0.0.236/trunk@9921 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
rjc%netscape.com 1998-09-12 02:37:57 +00:00
parent 921e6a3882
commit f4bf910c8a
4 changed files with 34 additions and 5 deletions

View File

@ -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

View File

@ -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

View File

@ -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)) {
parseNextRDFXMLBlob(stream, gDefaultNavcntr, strlen(gDefaultNavcntr));
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);

View File

@ -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