Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Icecast-Server
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
102
Issues
102
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Container Registry
Wiki
Wiki
External Wiki
External Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Xiph.Org
Icecast-Server
Commits
63cc9b9c
Commit
63cc9b9c
authored
Aug 01, 2018
by
Philipp Schafft
🦁
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Feature: Also route slow events to fastevent subsystem
parent
cdd09669
Pipeline
#290
failed with stage
in 11 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
0 deletions
+30
-0
src/event.c
src/event.c
+4
-0
src/main.c
src/main.c
+26
-0
No files found.
src/event.c
View file @
63cc9b9c
...
...
@@ -18,6 +18,7 @@
#include "event_log.h"
#include "event_exec.h"
#include "event_url.h"
#include "fastevent.h"
#include "logging.h"
#include "admin.h"
#include "connection.h"
...
...
@@ -334,6 +335,7 @@ void event_registration_push(event_registration_t **er, event_registration_t *ta
/* event signaling */
void
event_emit
(
event_t
*
event
)
{
fastevent_emit
(
FASTEVENT_TYPE_SLOWEVENT
,
FASTEVENT_FLAG_NONE
,
FASTEVENT_DATATYPE_EVENT
,
event
);
thread_mutex_lock
(
&
event_lock
);
event_push
(
&
event_queue
,
event
);
thread_mutex_unlock
(
&
event_lock
);
...
...
@@ -371,11 +373,13 @@ void event_emit_clientevent(const char *trigger, client_t *client, const char *u
* We do this before inserting all the data into the object to avoid
* all the strdups() and stuff in case they aren't needed.
*/
#ifndef FASTEVENT_ENABLED
if
(
event
->
reglist
[
0
]
==
NULL
)
{
/* we have no registrations, drop this event. */
event_release
(
event
);
return
;
}
#endif
if
(
client
)
{
const
char
*
tmp
;
...
...
src/main.c
View file @
63cc9b9c
...
...
@@ -120,12 +120,35 @@ static void _stop_logging(void)
log_close
(
playlistlog
);
}
#ifndef FASTEVENT_ENABLED
static
void
__fastevent_cb
(
const
void
*
userdata
,
fastevent_type_t
type
,
fastevent_flag_t
flags
,
fastevent_datatype_t
datatype
,
va_list
ap
)
{
event_t
*
event
;
if
(
datatype
!=
FASTEVENT_DATATYPE_EVENT
)
return
;
event
=
va_arg
(
ap
,
event_t
*
);
if
(
event
==
NULL
)
{
ICECAST_LOG_DEBUG
(
"event=%p"
,
event
);
}
else
{
ICECAST_LOG_DEBUG
(
"event=%p{.trigger='%s', ...}"
,
event
,
event
->
trigger
);
}
}
static
refobject_t
fastevent_reg
;
#endif
static
void
initialize_subsystems
(
void
)
{
log_initialize
();
thread_initialize
();
global_initialize
();
#ifndef FASTEVENT_ENABLED
fastevent_initialize
();
fastevent_reg
=
fastevent_register
(
FASTEVENT_TYPE_SLOWEVENT
,
__fastevent_cb
,
NULL
,
NULL
);
#endif
sock_initialize
();
resolver_initialize
();
config_initialize
();
...
...
@@ -154,7 +177,10 @@ static void shutdown_subsystems(void)
config_shutdown
();
resolver_shutdown
();
sock_shutdown
();
#ifndef FASTEVENT_ENABLED
refobject_unref
(
fastevent_reg
);
fastevent_shutdown
();
#endif
global_shutdown
();
thread_shutdown
();
...
...
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