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
cdd09669
Commit
cdd09669
authored
Jul 05, 2018
by
Philipp Schafft
🦁
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Feature: Added some more useful client fast events
parent
08cf0c12
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
0 deletions
+18
-0
src/client.c
src/client.c
+12
-0
src/connection.c
src/connection.c
+3
-0
src/fastevent.h
src/fastevent.h
+3
-0
No files found.
src/client.c
View file @
cdd09669
...
...
@@ -393,6 +393,8 @@ void client_send_101(client_t *client, reuse_t reuse)
client
->
respcode
=
101
;
client
->
refbuf
->
len
=
strlen
(
client
->
refbuf
->
data
);
fastevent_emit
(
FASTEVENT_TYPE_CLIENT_SEND_RESPONSE
,
FASTEVENT_FLAG_MODIFICATION_ALLOWED
,
FASTEVENT_DATATYPE_CLIENT
,
client
);
fserve_add_client
(
client
,
NULL
);
}
...
...
@@ -416,6 +418,8 @@ void client_send_204(client_t *client)
client
->
respcode
=
204
;
client
->
refbuf
->
len
=
strlen
(
client
->
refbuf
->
data
);
fastevent_emit
(
FASTEVENT_TYPE_CLIENT_SEND_RESPONSE
,
FASTEVENT_FLAG_MODIFICATION_ALLOWED
,
FASTEVENT_DATATYPE_CLIENT
,
client
);
fserve_add_client
(
client
,
NULL
);
}
...
...
@@ -446,6 +450,8 @@ void client_send_426(client_t *client, reuse_t reuse)
client
->
reuse
=
ICECAST_REUSE_KEEPALIVE
;
fastevent_emit
(
FASTEVENT_TYPE_CLIENT_SEND_RESPONSE
,
FASTEVENT_FLAG_MODIFICATION_ALLOWED
,
FASTEVENT_DATATYPE_CLIENT
,
client
);
fserve_add_client
(
client
,
NULL
);
}
...
...
@@ -457,6 +463,10 @@ static inline void client_send_500(client_t *client, const char *message)
const
ssize_t
header_len
=
sizeof
(
header
)
-
1
;
ssize_t
ret
;
client
->
respcode
=
500
;
client
->
refbuf
->
len
=
0
;
fastevent_emit
(
FASTEVENT_TYPE_CLIENT_SEND_RESPONSE
,
FASTEVENT_FLAG_MODIFICATION_ALLOWED
,
FASTEVENT_DATATYPE_CLIENT
,
client
);
ret
=
client_send_bytes
(
client
,
header
,
header_len
);
/* only send message if we have one AND if header could have transmitted completly */
...
...
@@ -576,6 +586,7 @@ void client_send_reportxml(client_t *client, reportxml_t *report, document_domai
client
->
refbuf
->
len
=
ret
;
xmlFree
(
buff
);
client
->
respcode
=
status
;
fastevent_emit
(
FASTEVENT_TYPE_CLIENT_SEND_RESPONSE
,
FASTEVENT_FLAG_MODIFICATION_ALLOWED
,
FASTEVENT_DATATYPE_CLIENT
,
client
);
fserve_add_client
(
client
,
NULL
);
}
else
{
char
*
fullpath_xslt_template
;
...
...
@@ -604,6 +615,7 @@ void client_send_reportxml(client_t *client, reportxml_t *report, document_domai
config_release_config
();
ICECAST_LOG_DEBUG
(
"Sending XSLT (%s)"
,
fullpath_xslt_template
);
fastevent_emit
(
FASTEVENT_TYPE_CLIENT_SEND_RESPONSE
,
FASTEVENT_FLAG_MODIFICATION_ALLOWED
,
FASTEVENT_DATATYPE_CLIENT
,
client
);
xslt_transform
(
doc
,
fullpath_xslt_template
,
client
,
status
);
free
(
fullpath_xslt_template
);
}
...
...
src/connection.c
View file @
cdd09669
...
...
@@ -1277,6 +1277,8 @@ static void _handle_authed_client(client_t *client, void *uri, auth_result resul
auth_stack_release
(
client
->
authstack
);
client
->
authstack
=
NULL
;
fastevent_emit
(
FASTEVENT_TYPE_CLIENT_AUTHED
,
FASTEVENT_FLAG_MODIFICATION_ALLOWED
,
FASTEVENT_DATATYPE_CLIENT
,
client
);
if
(
result
!=
AUTH_OK
)
{
client_send_error_by_id
(
client
,
ICECAST_ERROR_GEN_CLIENT_NEEDS_TO_AUTHENTICATE
);
free
(
uri
);
...
...
@@ -1417,6 +1419,7 @@ static void _handle_authentication_mount_normal(client_t *client, char *uri)
static
void
_handle_authentication
(
client_t
*
client
,
char
*
uri
)
{
fastevent_emit
(
FASTEVENT_TYPE_CLIENT_READY_FOR_AUTH
,
FASTEVENT_FLAG_MODIFICATION_ALLOWED
,
FASTEVENT_DATATYPE_CLIENT
,
client
);
_handle_authentication_mount_normal
(
client
,
uri
);
}
...
...
src/fastevent.h
View file @
cdd09669
...
...
@@ -29,6 +29,9 @@ typedef enum {
FASTEVENT_TYPE_CLIENT_READ
,
FASTEVENT_TYPE_CLIENT_WRITE
,
FASTEVENT_TYPE_CLIENT_READ_BODY
,
FASTEVENT_TYPE_CLIENT_READY_FOR_AUTH
,
FASTEVENT_TYPE_CLIENT_AUTHED
,
FASTEVENT_TYPE_CLIENT_SEND_RESPONSE
,
FASTEVENT_TYPE__END
/* must be last element */
}
fastevent_type_t
;
...
...
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