fastpath.c File Reference

#include "nsd.h"

Data Structures

struct  File

Defines

#define MAP_FAILED   ((void *) (-1))

Functions

Ns_Cache * NsFastpathCache (char *server, int size)
int Ns_ConnReturnFile (Ns_Conn *conn, int status, char *type, char *file)
char * Ns_PageRoot (char *server)
void Ns_SetUrlToFileProc (char *server, Ns_UrlToFileProc *procPtr)
int Ns_UrlToFile (Ns_DString *dsPtr, char *server, char *url)
int Ns_UrlIsFile (char *server, char *url)
int Ns_UrlIsDir (char *server, char *url)
int Ns_FastPathOp (void *arg, Ns_Conn *conn)
int NsUrlToFile (Ns_DString *dsPtr, NsServer *servPtr, char *url)

Define Documentation

#define MAP_FAILED   ((void *) (-1))

The following constants are defined for this file


Function Documentation

int Ns_ConnReturnFile ( Ns_Conn *  conn,
int  status,
char *  type,
char *  file 
)

----------------------------------------------------------------------

Ns_ConnReturnFile --

Send the contents of a file out the conn.

Results: NS_OK/NS_ERROR

Side effects: See FastReturn.

----------------------------------------------------------------------

int Ns_FastPathOp ( void *  arg,
Ns_Conn *  conn 
)

---------------------------------------------------------------------- Ns_FastPathOp --

Return the contents of a URL.

Results: Return NS_OK for success or NS_ERROR for failure.

Side effects: Contents of file may be cached in file cache.

----------------------------------------------------------------------

Return ordinary files as with Ns_ConnReturnFile.

For directories, search for a matching directory file and restart the connection if found.

If no index file was found, invoke a directory listing ADP or Tcl proc if configured.

char* Ns_PageRoot ( char *  server  ) 

---------------------------------------------------------------------- Ns_PageRoot --

Return path name of the server pages directory.

Results: Server pageroot or NULL on invalid server.

Side effects: None.

----------------------------------------------------------------------

void Ns_SetUrlToFileProc ( char *  server,
Ns_UrlToFileProc *  procPtr 
)

---------------------------------------------------------------------- Ns_SetUrlToFileProc --

Set pointer to custom routine that acts like Ns_UrlToFile();

Results: None.

Side effects: None.

----------------------------------------------------------------------

int Ns_UrlIsDir ( char *  server,
char *  url 
)

int Ns_UrlIsFile ( char *  server,
char *  url 
)

---------------------------------------------------------------------- Ns_UrlIsFile, Ns_UrlIsDir --

Check if a file/directory that corresponds to a URL exists.

Results: Return NS_TRUE if the file exists and NS_FALSE otherwise.

Side effects: None.

----------------------------------------------------------------------

int Ns_UrlToFile ( Ns_DString *  dsPtr,
char *  server,
char *  url 
)

---------------------------------------------------------------------- Ns_UrlToFile --

Construct the filename that corresponds to a URL.

Results: Return NS_OK on success or NS_ERROR on failure.

Side effects: None.

----------------------------------------------------------------------

Ns_Cache* NsFastpathCache ( char *  server,
int  size 
)

---------------------------------------------------------------------- NsFastpathCache --

Initialize the fastpath cache.

Results: Pointer to Ns_Cache.

Side effects: None.

----------------------------------------------------------------------

int NsUrlToFile ( Ns_DString *  dsPtr,
NsServer servPtr,
char *  url 
)


Generated on Tue Sep 4 19:58:56 2007 by  doxygen 1.5.1