Objecttype Example - Netscape ENTERPRISE SERVER 6.0 - NSAPI PROGRAMMER GUIDE Manual

Nsapi
Table of Contents

Advertisement

ObjectType Example

/* Working variables */
char *remip = pblock_findval("ip", sn->client);
register int x;
if(!hosts) {
}
for(x = 0; hosts[x] != NULL; ++x) {
}
/* Set response code to forbidden and return an error. */
protocol_status(sn, rq, PROTOCOL_FORBIDDEN, NULL);
return REQ_ABORTED;
}
ObjectType Example
The example in this section demonstrates how to implement
SAF that instructs the server to treat an
version of the requested file exists.
A well-behaved
if so, does nothing except return
if(pblock_findval("content-type", rq->srvhdrs))
The main thing an
is not already set). This example sets it to
following lines:
222
Netscape Enterprise Server NSAPI Programmer's Guide • November 2001
log_error(LOG_MISCONFIG, "restrict-by-acf", sn, rq,
"restrict-by-acf called without call to acf-init");
/* When we abort, the default status code is 500 Server
Error */
return REQ_ABORTED;
/* If they're on the list, they're allowed */
if(!strcmp(remip, hosts[x]))
return REQ_NOACTION;
ObjectType
return REQ_NOACTION;
ObjectType
file as a
.html
function checks if the content type is already set, and
.
REQ_NOACTION
directive needs to do is to set the content type (if it
magnus-internal/parsed-html
, a custom
html2shtml
file if a
.shtml
.shtml
in the

Advertisement

Table of Contents
loading

This manual is also suitable for:

Enterprise server 6.0

Table of Contents