Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Icecast-Server
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
94
Issues
94
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
External Wiki
External Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Xiph.Org
Icecast-Server
Commits
de6e8b41
Commit
de6e8b41
authored
Sep 28, 2018
by
Philipp Schafft
🦁
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Feature: Added support to set listen(2) backlog.
Closes:
#2225
parent
dd967ad1
Pipeline
#327
failed with stage
in 12 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
1 deletion
+21
-1
src/cfgfile.c
src/cfgfile.c
+3
-0
src/cfgfile.h
src/cfgfile.h
+1
-0
src/listensocket.c
src/listensocket.c
+17
-1
No files found.
src/cfgfile.c
View file @
de6e8b41
...
...
@@ -1911,6 +1911,8 @@ static void _parse_listen_socket(xmlDocPtr doc,
node
->
xmlChildrenNode
,
1
);
}
else
if
(
xmlStrcmp
(
node
->
name
,
XMLSTR
(
"so-sndbuf"
))
==
0
)
{
__read_int
(
doc
,
node
,
&
listener
->
so_sndbuf
,
"<so-sndbuf> must not be empty."
);
}
else
if
(
xmlStrcmp
(
node
->
name
,
XMLSTR
(
"listen-backlog"
))
==
0
)
{
__read_int
(
doc
,
node
,
&
listener
->
listen_backlog
,
"<listen-backlog> must not be empty."
);
}
else
if
(
xmlStrcmp
(
node
->
name
,
XMLSTR
(
"authentication"
))
==
0
)
{
_parse_authentication_node
(
node
,
&
(
listener
->
authstack
));
}
...
...
@@ -2629,6 +2631,7 @@ listener_t *config_copy_listener_one(const listener_t *listener) {
n
->
next
=
NULL
;
n
->
port
=
listener
->
port
;
n
->
so_sndbuf
=
listener
->
so_sndbuf
;
n
->
listen_backlog
=
listener
->
listen_backlog
;
n
->
type
=
listener
->
type
;
n
->
id
=
(
char
*
)
xmlStrdup
(
XMLSTR
(
listener
->
id
));
if
(
listener
->
on_behalf_of
)
{
...
...
src/cfgfile.h
View file @
de6e8b41
...
...
@@ -161,6 +161,7 @@ typedef struct _listener_t {
listener_type_t
type
;
int
port
;
int
so_sndbuf
;
int
listen_backlog
;
char
*
bind_address
;
int
shoutcast_compat
;
char
*
shoutcast_mount
;
...
...
src/listensocket.c
View file @
de6e8b41
...
...
@@ -73,6 +73,20 @@ static inline const char * __string_default(const char *str, const char *def)
return
str
!=
NULL
?
str
:
def
;
}
static
inline
int
__socket_listen
(
sock_t
serversock
,
const
listener_t
*
listener
)
{
int
listen_backlog
=
listener
->
listen_backlog
;
if
(
listen_backlog
<
1
)
listen_backlog
=
ICECAST_LISTEN_QUEUE
;
if
(
listen_backlog
>
128
)
{
listen_backlog
=
128
;
ICECAST_LOG_WARN
(
"Listen backlog for listen socket on %s port %i is set insanely high. Limiting to sane range."
,
__string_default
(
listener
->
bind_address
,
"<ANY>"
),
listener
->
port
);
}
return
sock_listen
(
serversock
,
listen_backlog
);
}
static
inline
int
__listener_cmp
(
const
listener_t
*
a
,
const
listener_t
*
b
)
{
if
(
a
==
b
)
...
...
@@ -581,6 +595,8 @@ static int listensocket_apply_config__unlocked(listensocket_t *self
sock_set_send_buffer
(
self
->
sock
,
listener
->
so_sndbuf
);
sock_set_blocking
(
self
->
sock
,
0
);
__socket_listen
(
self
->
sock
,
listener
);
}
if
(
self
->
listener_update
)
{
...
...
@@ -632,7 +648,7 @@ int listensocket_refsock(listensocket_t *self)
return
-
1
;
}
if
(
sock_listen
(
self
->
sock
,
ICECAST_LISTEN_QUEUE
)
==
0
)
{
if
(
__socket_listen
(
self
->
sock
,
self
->
listener
)
==
0
)
{
sock_close
(
self
->
sock
);
self
->
sock
=
SOCK_ERROR
;
thread_rwlock_rlock
(
&
self
->
listener_rwlock
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment