Main Page   Modules   Data Structures   File List   Data Fields   Globals   Related Pages   Examples  

/opentcp/http/https_callbacks.c File Reference


Detailed Description

Author:
Version:
1.0
Date:
9.10.2002
Bug:
Warning:
Todo:

This file holds definitions and descriptions of HTTP callback functions that will be overridden by user code. These callback functions are invoked by HTTP server to get a feedback from the part of HTTP server who's behaviour is defined by the user application.

Definition in file https_callbacks.c.

Go to the source code of this file.

Functions

INT16 https_findfile (UINT8 hash, UINT8 ses)
 Brief function description here.

INT16 https_loadbuffer (UINT8 ses, UINT8 *buf, UINT16 buflen)
 Fill network transmit buffer with HTTP headers&data.


Variables

const char https_not_found_page []
 File not found message.


Function Documentation

INT16 https_findfile UINT8    hash,
UINT8    ses
 

Author:
Date:
09.10.2002
Parameters:
hash  Calculated file-name hash value. Used so that the whole file name doesn't need to be stored in RAM
ses  HTTP session identifier
Returns:
  • -1 - This function should return -1 if no file has been found
  • 1 - This function should return 1 if a file with appropriate hash value has been found.
Warning:
  • This function MUST be implemented by user application to work with local configuration
This function is invoked by the HTTP server once a hash value of a requested file name has been calculated. User application uses this hash value to check if appropriate file is available to web server. Appropriate https session entry is then filled accordingly.

Definition at line 124 of file https_callbacks.c.

INT16 https_loadbuffer UINT8    ses,
UINT8 *    buf,
UINT16    buflen
 

Author:
Date:
09.10.2002
Parameters:
ses  HTTP session identifier
buf  Pointer to buffer where data is to be stored
buflen  Length of the buffer in bytes
Returns:
  • >=0 - Number of bytes written to buffer
Warning:
  • This function MUST be implemented by user application to work with local configuration
This handlers' job is to fill the buffer with the data that web server should return back through the TCP connection. This is accomplished based session identifer and values of variables in appropriate https entry.

Definition at line 173 of file https_callbacks.c.

References https_not_found_page.


Variable Documentation

const char https_not_found_page[]
 

Initial value:

 "HTTP/1.0 200 OK\r\n
Last-modified: Fri, 18 Oct 2002 12:04:32 GMT\r\n
Server: ESERV-10/1.0\nContent-type: text/html\r\n
Content-length: 400\r\n
\r\n
<HEAD>
<TITLE>Viola Systems Embedded WEB Server</TITLE></HEAD>
<BODY>
<H2>HTTP 1.0 404 Error. File Not Found</H2>
The requested URL was not found on this server.
<HR>
<BR>
<I>
Viola Systems Embedded WEB Server 2.0, 2002
<BR>
Web Server for Embedded Applications
</I>
<BR>
<A HREF=http://www.violasystems.com>
www.violasystems.com - Embedding The Internet</A>
</BODY>"
Message that will be displayed if a file with appropriate name (hash value) was not found.

Definition at line 81 of file https_callbacks.c.

Referenced by https_loadbuffer().


Generated on Sun Aug 3 20:33:00 2003 for OpenTCP by doxygen1.2.18