mirror of
https://github.com/morgan9e/UxPlay
synced 2026-04-14 00:04:13 +09:00
httpd: provide name of connection type
This commit is contained in:
@@ -29,7 +29,6 @@
|
||||
#include "logger.h"
|
||||
#include "utils.h"
|
||||
|
||||
|
||||
static const char *typename[] = {
|
||||
[CONNECTION_TYPE_UNKNOWN] = "Unknown",
|
||||
[CONNECTION_TYPE_RAOP] = "RAOP",
|
||||
@@ -38,7 +37,6 @@ static const char *typename[] = {
|
||||
[CONNECTION_TYPE_HLS] = "HLS"
|
||||
};
|
||||
|
||||
|
||||
struct http_connection_s {
|
||||
int connected;
|
||||
|
||||
@@ -69,6 +67,11 @@ struct httpd_s {
|
||||
int server_fd6;
|
||||
};
|
||||
|
||||
const char *
|
||||
httpd_get_connection_typename (connection_type_t type) {
|
||||
return typename[type];
|
||||
}
|
||||
|
||||
int
|
||||
httpd_get_connection_socket (httpd_t *httpd, void *user_data) {
|
||||
for (int i = 0; i < httpd->max_connections; i++) {
|
||||
|
||||
@@ -44,6 +44,7 @@ int httpd_set_connection_type (httpd_t *http, void *user_data, connection_type_t
|
||||
int httpd_count_connection_type (httpd_t *http, connection_type_t type);
|
||||
int httpd_get_connection_socket (httpd_t *httpd, void *user_data);
|
||||
int httpd_get_connection_socket_by_type (httpd_t *httpd, connection_type_t type, int instance);
|
||||
const char *httpd_get_connection_typename (connection_type_t type);
|
||||
void *httpd_get_connection_by_type (httpd_t *httpd, connection_type_t type, int instance);
|
||||
httpd_t *httpd_init(logger_t *logger, httpd_callbacks_t *callbacks, int nohold);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user