nth_server.c File Reference


Detailed Description

HTTP server.

Author:
Pekka Pessi <Pekka.Pessi@nokia-email.address.hidden>
Date:
Created: Sat Oct 19 01:37:36 2002 ppessi

#include "config.h"
#include <stddef.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdarg.h>
#include <errno.h>
#include <assert.h>
#include <sofia-sip/string0.h>
#include <sofia-sip/hostdomain.h>
#include <sofia-sip/http_header.h>
#include <sofia-sip/http_status.h>
#include <sofia-sip/http_tag.h>
#include "sofia-sip/nth.h"
#include <sofia-sip/msg_date.h>
#include <sofia-sip/msg_addr.h>
#include <sofia-sip/su_tagarg.h>
#include <sofia-sip/tport.h>
#include <sofia-sip/htable.h>
#include <sofia-sip/auth_module.h>
#include <sofia-sip/su_debug.h>

Include dependency graph for nth_server.c:


Functions

int server_timer_init (server_t *srv)
 Initialize server timer.
uint32_t server_now (server_t const *srv)
 Get current timestamp in milliseconds.
nth_site_tnth_site_create (nth_site_t *parent, nth_request_f *callback, nth_site_magic_t *magic, url_string_t const *address, tag_type_t tag, tag_value_t value,...)
 Create a http site object.
url_t const * nth_site_url (nth_site_t const *site)
 Get the site URL.
char const * nth_site_server_version (void)
 Return server name and version.
su_time_t nth_site_access_time (nth_site_t const *site)
 Get the time last time served.
int nth_request_status (nth_request_t const *req)
 Return request authentication status.
auth_status_t * nth_request_auth (nth_request_t const *req)
 Return request authentication status.

Variables

char const NTH_DEBUG []
 Environment variable determining the debug log level for nth module.
su_log_t nth_server_log []
 Debug log for nth module.

Function Documentation

auth_status_t* nth_request_auth ( nth_request_t const *  req  ) 

Return request authentication status.

Parameters:
req pointer to HTTP request object
Return values:
Pointer to authentication status struct
Note:
The authentication status struct is freed when the nth_request_t object is destroyed.
Since:
New in 1.12.4
See also:
AUTH

int nth_request_status ( nth_request_t const *  req  ) 

Return request authentication status.

Parameters:
req pointer to HTTP request object
Return values:
Status code
Since:
New in 1.12.4

su_time_t nth_site_access_time ( nth_site_t const *  site  ) 

Get the time last time served.

Since:
New in 1.12.4.

nth_site_t* nth_site_create ( nth_site_t parent,
nth_request_f *  callback,
nth_site_magic_t magic,
url_string_t const *  address,
tag_type_t  tag,
tag_value_t  value,
  ... 
)

Create a http site object.

The function nth_site_create() allocates and initializes a web site object. A web site object can be either

Parameters:
parent pointer to parent site (NULL when creating a primary server object)
callback pointer to callback function called when a request is received
magic application context included in callback parameters
address absolute or relative URI specifying the address of site
tag,value,... list of tagged parameters
Related Tags:
If the parent is NULL, the list of tagged parameters must contain NTHTAG_ROOT() used to create the server engine. Tags supported when parent is NULL are NTHTAG_ROOT(), NTHTAG_MCLASS(), TPTAG_REUSE(), HTTPTAG_SERVER(), and HTTPTAG_SERVER_STR(). All the tags are passed to tport_tcreate() and tport_tbind(), too.
Since:
Support for multiple sites was added to 1.12.4

url_t const* nth_site_url ( nth_site_t const *  site  ) 

Get the site URL.

Since:
New in 1.12.4.


Variable Documentation

char const NTH_DEBUG[]

Environment variable determining the debug log level for nth module.

The NTH_DEBUG environment variable is used to determine the debug logging level for nth module. The default level is 1.

See also:
<su_debug.h>, nth_server_log, SOFIA_DEBUG

su_log_t nth_server_log[]

Debug log for nth module.

The nth_server_log is the log object used by nth module. The level of nth_server_log is set using NTH_DEBUG environment variable.


Sofia-SIP 1.12.6 - Copyright (C) 2006 Nokia Corporation. All rights reserved. Licensed under the terms of the GNU Lesser General Public License.