* * $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 MY_FSDEV devUrom |
#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.
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().
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().
static int CgiShoutCastStations | ( | FILE * | stream, | |
REQUEST * | req | |||
) | [static] |
Definition at line 242 of file httpserv.c.
References ShoutCastGetStationName().
Referenced by HttpServerStart().
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().
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().
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().
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().
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().
int HttpServerStart | ( | void | ) |
void* __heap_start |
int h_timevalid |
int httpd_tc [static] |