![Netscape ENTERPRISE SERVER 6.1 Скачать руководство пользователя страница 231](http://html1.mh-extra.com/html/netscape/enterprise-server-6-1/enterprise-server-6-1_manual_1674653231.webp)
Service Example
Chapter
6
Examples of Custom SAFs
231
/* Write the output using net_write*/
return_value = net_write(sn->csd, simple_msg,
strlen(simple_msg));
if (return_value == IO_ERROR) {
return REQ_EXIT;
}
return REQ_PROCEED;
}
More Complex Service Example
The
send-images
function is a custom SAF which replaces the
doit.cgi
demonstration available on the Netscape home pages. When a file is accessed as
/dir1/dir2/something.picgroup
, the
send-images
function checks if the file is
being accessed by a
Mozilla/1.1
browser. If not, it sends a short error message.
The file
something.picgroup
contains a list of lines, each of which specifies a
filename followed by a content-type (for example,
one.gif image/gif
).
To load the shared object containing your function, add the following line at the
beginning of the
magnus.conf
file:
Init fn=load-modules shlib=
yourlibrary
funcs=send-images
Also, add the following line to the
mime.types
file:
type=magnus-internal/picgroup exts=picgroup
To execute the custom SAF during the request-response process for some object,
add the following line to that object in the
obj.conf
file (
send-images
takes an
optional parameter,
delay
, which is not used for this example):
The source code is in
service.c
in the
nsapi/examples/
or
plugins/nsapi/examples
subdirectory within the server root directory.
Service method=(GET|HEAD) type=magnus-internal/picgroup
fn=send-images
Содержание 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...