webradio/httpserv.c File Reference


Detailed Description

HTTP interface.

 *
 * $Log$
 *
 * 

Definition in file httpserv.c.

Go to the source code of this file.

Defines

#define MY_FSDEV   devUrom
#define HTTPD_THREAD_STACK   2048
#define EMPTY_GAIN   999
 Dummy gain.

Functions

static int StartServiceThread (void)
static int CgiStationFavorites (FILE *stream, REQUEST *req)
 Create table of favorites.
static int CgiShoutCastGenres (FILE *stream, REQUEST *req)
static int CgiShoutCastStations (FILE *stream, REQUEST *req)
static int CgiShoutCastControl (FILE *stream, REQUEST *req)
static void AddStationUris (int idx, CONST char *str)
static int CgiFavoritesControl (FILE *stream, REQUEST *req)
static int CgiSettings (FILE *stream, REQUEST *req)
static int CgiVars (FILE *stream, REQUEST *req)
void Service (void *arg)
 HTTP service thread.
int HttpServerStart (void)
 HTTP Server Start.

Variables

void * __heap_start
int h_timevalid
static int httpd_tc


Define Documentation

#define MY_FSDEV   devUrom

Definition at line 47 of file httpserv.c.

Referenced by HttpServerStart().

#define HTTPD_THREAD_STACK   2048

Definition at line 62 of file httpserv.c.

#define EMPTY_GAIN   999

Dummy gain.

Used to determine volume field that had been left empty. We can't use zero.

Definition at line 102 of file httpserv.c.


Function Documentation

static int StartServiceThread ( void   )  [static]

Definition at line 726 of file httpserv.c.

References HTTPD_SERVICE_STACK, httpd_tc, and Service().

Referenced by HttpServerStart(), and Service().

Here is the call graph for this function:

ServiceLogMsgTcpStreamAccept

static int CgiStationFavorites ( FILE *  stream,
REQUEST *  req 
) [static]

Create table of favorites.

Definition at line 119 of file httpserv.c.

References favlist, LAST_FAVORITE, MAX_FAVORITES, and RADIOSTATION::rs_streams.

Referenced by HttpServerStart().

static int CgiShoutCastGenres ( FILE *  stream,
REQUEST *  req 
) [static]

Definition at line 198 of file httpserv.c.

References ShoutCastGetGenre().

Referenced by HttpServerStart().

Here is the call graph for this function:

ShoutCastGetGenre

static int CgiShoutCastStations ( FILE *  stream,
REQUEST *  req 
) [static]

Definition at line 242 of file httpserv.c.

References ShoutCastGetStationName().

Referenced by HttpServerStart().

Here is the call graph for this function:

ShoutCastGetStationName

static int CgiShoutCastControl ( FILE *  stream,
REQUEST *  req 
) [static]

Definition at line 281 of file httpserv.c.

References MAX_FAVORITES, ShoutCastAddStation(), TOP_FAVORITE, webradio, and WEBRADIO::wr_favupd.

Referenced by HttpServerStart().

Here is the call graph for this function:

ShoutCastAddStation

static void AddStationUris ( int  idx,
CONST char *  str 
) [static]

Definition at line 316 of file httpserv.c.

References FavListSet(), LOG_HTTPD, and LogMsg().

Referenced by CgiFavoritesControl().

Here is the call graph for this function:

FavListSetLogMsg

static int CgiFavoritesControl ( FILE *  stream,
REQUEST *  req 
) [static]

Definition at line 345 of file httpserv.c.

References AddStationUris(), FavListCopy(), FavListSet(), MAX_FAVORITES, TOP_FAVORITE, webradio, and WEBRADIO::wr_favupd.

Referenced by HttpServerStart().

Here is the call graph for this function:

AddStationUrisFavListSetFavListCopyLogMsg

static int CgiSettings ( FILE *  stream,
REQUEST *  req 
) [static]

Definition at line 395 of file httpserv.c.

References ConfigResetFactory(), ConfigSave(), confnet, confos, FavListResetFactory(), FavListSave(), LOG_HTTPD, LogMsg(), NutNetSaveConfig(), NutSaveConfig(), proxy, HTTP_PROXY::proxy_host, HTTP_PROXY::proxy_port, webradio, WEBRADIO::wr_pridns, WEBRADIO::wr_reboot, and WEBRADIO::wr_secdns.

Referenced by HttpServerStart().

Here is the call graph for this function:

ConfigResetFactoryConfigSaveFavListResetFactoryFavListSaveLogMsgNutNetSaveConfigNutSaveConfigConfigFlushConfigRewindConfigSaveBinary

static int CgiVars ( FILE *  stream,
REQUEST *  req 
) [static]

Definition at line 580 of file httpserv.c.

References RECEIVERINFO::ri_bcast, SHOUTCASTINFO::sci_metaint, SHOUTCASTINFO::sci_metatitle, SHOUTCASTINFO::sci_metaurl, STATIONINFO::si_bitrate, STATIONINFO::si_genre, STATIONINFO::si_name, VERSION, webradio, WEBRADIO::wr_rip, and WEBRADIO::wr_sip.

Referenced by HttpServerStart().

Service ( void *  arg  ) 

HTTP service thread.

The endless loop in this thread waits for a client connect, processes the HTTP request and disconnects. Nut/Net doesn't support a server backlog. If one client has established a connection, further connect attempts will be rejected. Typically browsers open more than one connection in order to load images concurrently. So we run this routine by several threads.

Definition at line 662 of file httpserv.c.

References HTTPD_MAX_SEGSIZE, HTTPD_MIN_THREADS, httpd_tc, HTTPD_TCP_BUFSIZE, HTTPD_TCP_PORT, HTTPD_TCP_TIMEOUT, LOG_HTTPD, LOG_WARN, LogMsg(), StartServiceThread(), and TcpStreamAccept().

Referenced by StartServiceThread().

Here is the call graph for this function:

LogMsgStartServiceThreadTcpStreamAccept

int HttpServerStart ( void   ) 

HTTP Server Start.

Definition at line 745 of file httpserv.c.

Referenced by main().


Variable Documentation

void* __heap_start

int h_timevalid

Definition at line 107 of file httpserv.c.

Referenced by main().

int httpd_tc [static]

Definition at line 111 of file httpserv.c.

Referenced by Service(), and StartServiceThread().


© 2008 by egnite GmbH - visit www.ethernut.de