Main Page   Data Structures   File List   Data Fields   Globals   Related Pages  

reqhandler_file.h File Reference

pdeppd's requesthandler for files. More...

#include "common.h"
#include "buffer.h"
#include "http.h"

Include dependency graph for reqhandler_file.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Typedefs

typedef ReqHandlerFile * ReqHandlerFile
 the struct containing all necessary information (on file-level) for a file transfer.


Functions

int rhfModulePreInit ()
 initialize / calculate static values. More...

int rhfModuleTerminate ()
 free all static ressourcesallocated. More...

ReqHandlerFile rhfInit (HttpProtHandler parent, const char *path_buf, int change_path)
 creates, initializes and returns a file-request Handler. More...

int rhfReceive (ReqHandlerFile this, struct Buffer *buf)
 orders a ProtHandler to Recieve data. More...

int rhfSend (ReqHandlerFile this, struct Buffer **buf)
 orders a ProtHandler to send buffered data. More...

int rhfProcess (ReqHandlerFile this)
 gives the chance to do some internal job. More...

int rhfIsDataPending (ReqHandlerFile this)
 checks if data is pending. More...

int rhfTerminate (ReqHandlerFile this)
 terminates this. More...

int rhfGetError (ReqHandlerFile this)
 returns the error of this. More...

size_t rhfGetSourceSize (ReqHandlerFile this)
 returns the file size of the requested file. More...

time_t rhfGetModTime (ReqHandlerFile this)
 returns the files modification date. More...

const char * rhfGetAllow (ReqHandlerFile this)
 returns the allows connected to the file. More...

const char * rhfGetContentType (ReqHandlerFile this)
 returns the files extension. More...


Detailed Description

pdeppd's requesthandler for files.

Definition in file reqhandler_file.h.


Function Documentation

const char* rhfGetAllow ReqHandlerFile    this
 

returns the allows connected to the file.

Parameters:
this  the struct to be manipulated
Returns:
the allows

Referenced by buildEntityHeader().

const char* rhfGetContentType ReqHandlerFile    this
 

returns the files extension.

Parameters:
this  the struct to be manipulated
Returns:
the extension, or the file itselfe, if no extension is found

Referenced by buildEntityHeader().

int rhfGetError ReqHandlerFile    this
 

returns the error of this.

Parameters:
this  the struct to be manipulated
Returns:
error of this

Referenced by htRecvLine().

time_t rhfGetModTime ReqHandlerFile    this
 

returns the files modification date.

Parameters:
this  the struct to be manipulated
Returns:
the modification date of the file

Referenced by buildEntityHeader().

size_t rhfGetSourceSize ReqHandlerFile    this
 

returns the file size of the requested file.

Parameters:
this  the struct to be manipulated
Returns:
the size of the file

ReqHandlerFile rhfInit HttpProtHandler    parent,
const char *    path_buf,
int    change_path
 

creates, initializes and returns a file-request Handler.

Parameters:
parent  Parent ie. caller
path_buf  the path of the file (absolute or relative)
change_path  if true the path ist converted into an absolute path (/../ is removed), else the path is take as it is
rhfInit initialises some std. values and resets data. It also opens a filehandler to be used later. If an error occures, or the file doesnt exist, error is set to the errorcode.

Returns:
an initialized file-requesthandler

Referenced by htRecvLine().

int rhfIsDataPending ReqHandlerFile    this
 

checks if data is pending.

Parameters:
this  the struct containing data information
Returns:
true if data pending, else false

Referenced by htIsDataPending(), and htSend().

int rhfModulePreInit  
 

initialize / calculate static values.

Returns:
0 on success, -1 on failure

int rhfModuleTerminate  
 

free all static ressourcesallocated.

Returns:
0 on success, -1 on failure

int rhfProcess ReqHandlerFile    this
 

gives the chance to do some internal job.

Parameters:
this  the struct containing data information
gives this the chance to do some internal work. NOTHING IMPLEMENTED NOW

Returns:
0 on success, -1 on error (error of this is set to concrete error)

Referenced by htProcess().

int rhfReceive ReqHandlerFile    this,
struct Buffer   buf
 

orders a ProtHandler to Recieve data.

Parameters:
this  the struct to be manipulated
str  the string containing the data to be recieved
rhfRecieve has to be understood as rhfRecieve!, because it is a call to do so. NOTHING IMPLEMENTED NOW (function unused)!

Returns:
0 on success, -1 if any error occured (error of this is set to concrete error)

int rhfSend ReqHandlerFile    this,
struct Buffer **    buf
 

orders a ProtHandler to send buffered data.

Parameters:
this  the struct containing data information
buf  the buffer (pnter), in which the data will be stored
rhfSend has to be understood as rhfSend!, because it is a call to do so. If data is waiting, it will be stored in buf, else (*buf)->data is set to NULL.

Returns:
0 on success, -1 on error (error of this is set to concrete error)

Referenced by htSend().

int rhfTerminate ReqHandlerFile    this
 

terminates this.

Parameters:
this  the struct to be terminated
terminates this and frees all allocated memory used by this.

Returns:
0 on success, -1 on error (error of this is set to concrete error)

Referenced by htRecvLine(), and htTerminate().


Generated on Fri Jan 25 22:40:59 2002 for PDepp Webserver by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001