![Netscape ENTERPRISE SERVER 6.1 Скачать руководство пользователя страница 340](http://html1.mh-extra.com/html/netscape/enterprise-server-6-1/enterprise-server-6-1_manual_1674653340.webp)
340
Netscape Enterprise Server NSAPI Programmer’s Guide • April 2002 (Draft)
The plugin may simply decide to replace the cached entry even if it has not expired
(based on some other business logic). The
dr_cache_refresh
function is useful in
this case. This way the plugin does the cache refresh management actively by itself.
Syntax
PRInt32 dr_cache_refresh(DrHdl hdl, const char *key, PRUint32 klen,
PRIntervalTime timeout, Entry *entry, Request *rq, Session *sn);
Returns
1
if successful.
0
if an error occurs.
Parameters
DrHdl hdl
is a persistent handle created by the
dr_cache_init
function.
const char *key
is the key to cache, search, or refresh.
PRUint32 klen
is the length of the key in bytes.
PRIntervalTime timeout
is the expiration time of this entry. If a value of 0 is
passed, the
maxAge
value passed to
dr_cache_init
is used.
Entry *entry
is the not NULL entry to be cached.
Request *rq
is a pointer to the request.
Session *sn
is a pointer to the session.
Example
Entry entry;
char *key = "MOVIES"
GenNewMovieList(&entry.data, &entry.dataLen);
// Implemented by
// plugin developer
if(!dr_cache_refresh(hdl, key, strlen(key), 0, &entry, rq, sn))
{
ereport(LOG_FAILURE, "dr_cache_refresh() failed");
return REQ_ABORTED;
}
dr_net_write
The
dr_net_write
function sends a response back to the requestor after
constructing the full page with
hdr
, the content of the cached entry as the body
(located using the
key
), and
ftr
. The
hdr
,
ftr
, or
hdl
can be NULL, but not all of
them can be NULL. If
hdl
is NULL, no cache lookup is done; the caller must pass
DR_NONE
as the flag.
Содержание ENTERPRISE SERVER 6.1
Страница 1: ...NSAPI Programmer s Guide Netscape Enterprise Server Version6 1 April 2002 Draft...
Страница 18: ...Where to Find Related Information 18 Netscape Enterprise Server NSAPI Programmer s Guide April 2002 Draft...
Страница 138: ...CGI to NSAPI Conversion 138 Netscape Enterprise Server NSAPI Programmer s Guide April 2002 Draft...
Страница 214: ...NSAPI Functions in Alphabetical Order 214 Netscape Enterprise Server NSAPI Programmer s Guide April 2002 Draft...
Страница 290: ...Miscellaneous 290 Netscape Enterprise Server NSAPI Programmer s Guide April 2002 Draft...
Страница 310: ...The Netscape LDAP Schema 310 Netscape Enterprise Server NSAPI Programmer s Guide April 2002 Draft...
Страница 318: ...cinfo 318 Netscape Enterprise Server NSAPI Programmer s Guide April 2002 Draft...
Страница 324: ...Sample MIME Types File 324 Netscape Enterprise Server NSAPI Programmer s Guide April 2002 Draft...
Страница 336: ...Buffered Streams 336 Netscape Enterprise Server NSAPI Programmer s Guide April 2002 Draft...
Страница 344: ...344 Netscape Enterprise Server NSAPI Programmer s Guide April 2002 Draft...
Страница 350: ...350 Netscape Enterprise Server NSAPI Programmer s Guide April 2002 Draft...
Страница 356: ...356 Netscape Enterprise Server NSAPI Programmer s Guide April 2002 Draft...