🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.infosystems.www.servers.unix
1 messages
1 total messages Started by fortune@netvisio Sat, 02 Sep 1995 00:00
Problem creating a new Apache module
#3900
Author: fortune@netvisio
Date: Sat, 02 Sep 1995 00:00
86 lines
2125 bytes
Hello,

I am trying to create a new apache module. The module includes a response
handler which should handle a mime type called "fortune/mine," expecting
calls for files with extension .mine.

I am using Apache 0.8.8 and Linux 1.2.3.

I have added the following AddType to srm.conf:

AddType fortune/mine .mine

I have created my new module "mod_fortune.c," added it to Configuration,
ran Configure and maked the whole package again.

Everythings seems fine, only that when I ask for a file with extension .mine,
from Netscape, I get a window asking me where I would like to place the file
after it is downloaded to my machine. This happens, by the way, either if the
mine file exists or not.

Following is mod_fortune.c source code. Please note that the handler itself
should do nothing but send some file to the client, at this stage:


------------------------------
#include "httpd.h"
#include "http_config.h"
#include "http_protocol.h"
#include "http_log.h"
#include "util_script.h"
#include "http_main.h"

#define MINE_MAGIC_TYPE "fortune/mine"

int mine_handler (request_rec *r)
{
    FILE *f;

    f = fopen ("/home/oded/textfile", "r");

    scan_script_header (r, f);
    soft_timeout("send", r);
    send_http_header (r);
    send_fd(f, r);
    fclose(f);

    return OK;
}

handler_rec fortune_handlers[] = {
{ MINE_MAGIC_TYPE, mine_handler },
{ NULL }
};

module fortune_module = {
   STANDARD_MODULE_STUFF,
   NULL,			/* initializer */
   NULL,			/* create per-directory config structure */
   NULL,			/* merge per-directory config structures */
   NULL,			/* create per-server config structure */
   NULL,			/* merge per-server config structures */
   NULL,			/* command table */
   fortune_handlers,		/* handlers */
   NULL,			/* translate_handler */
   NULL,			/* check_user_id */
   NULL,			/* check auth */
   NULL,			/* check access */
   NULL,			/* type_checker */
   NULL,			/* pre-run fixups */
   NULL				/* logger */
};
--------------------------


I would greatly appreciate any help. Please send replies by e-mail
to fortune@netvision.net.il.


Thanks,
Oded Gonda
fortune@netvision.net.il




Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads