mirror of
https://gitlab.xiph.org/xiph/icecast-server.git
synced 2025-01-03 14:56:34 -05:00
Feature: Support asking a listen socket for it's family
This commit is contained in:
parent
4319e8c0e6
commit
80972517da
@ -799,6 +799,20 @@ listener_type_t listensocket_get_type(listensocket_t *self)
|
||||
return ret;
|
||||
}
|
||||
|
||||
sock_family_t listensocket_get_family(listensocket_t *self)
|
||||
{
|
||||
sock_family_t ret;
|
||||
|
||||
if (!self)
|
||||
return SOCK_FAMILY__ERROR;
|
||||
|
||||
thread_mutex_lock(&self->lock);
|
||||
ret = sock_get_family(self->sock);
|
||||
thread_mutex_unlock(&self->lock);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
#ifdef HAVE_POLL
|
||||
static inline int listensocket__poll_fill(listensocket_t *self, struct pollfd *p)
|
||||
{
|
||||
|
@ -9,6 +9,8 @@
|
||||
#ifndef __LISTENSOCKET_H__
|
||||
#define __LISTENSOCKET_H__
|
||||
|
||||
#include "common/net/sock.h"
|
||||
|
||||
#include "icecasttypes.h"
|
||||
#include "refobject.h"
|
||||
#include "cfgfile.h"
|
||||
@ -32,6 +34,7 @@ connection_t * listensocket_accept(listensocket_t *self, listensock
|
||||
const listener_t * listensocket_get_listener(listensocket_t *self);
|
||||
int listensocket_release_listener(listensocket_t *self);
|
||||
listener_type_t listensocket_get_type(listensocket_t *self);
|
||||
sock_family_t listensocket_get_family(listensocket_t *self);
|
||||
|
||||
const char * listensocket_type_to_string(listener_type_t type);
|
||||
const char * listensocket_tlsmode_to_string(tlsmode_t mode);
|
||||
|
Loading…
Reference in New Issue
Block a user