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
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
spr0cketeer
Icecast-Server
Commits
143a8b71
Commit
143a8b71
authored
Nov 13, 2018
by
Philipp Schafft
🦁
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix: Send final reply to client on HTTP upgrade
Closes: #2356
parent
7637e8f5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
4 deletions
+28
-4
src/client.c
src/client.c
+21
-4
src/connection.c
src/connection.c
+6
-0
src/connection.h
src/connection.h
+1
-0
No files found.
src/client.c
View file @
143a8b71
...
...
@@ -169,8 +169,28 @@ static inline void client_reuseconnection(client_t *client) {
return
;
con
=
client
->
con
;
con
=
connection_create
(
con
->
sock
,
con
->
listensocket_real
,
con
->
listensocket_effective
,
strdup
(
con
->
ip
));
reuse
=
client
->
reuse
;
if
(
reuse
==
ICECAST_REUSE_UPGRADETLS
)
{
http_parser_t
*
parser
=
client
->
parser
;
httpp_deletevar
(
parser
,
"upgrade"
);
client
->
reuse
=
ICECAST_REUSE_CLOSE
;
/* release the buffer now, as the buffer could be on the source queue
* and may of disappeared after auth completes */
client_set_queue
(
client
,
NULL
);
client
->
refbuf
=
refbuf_new
(
PER_CLIENT_REFBUF_SIZE
);
client
->
refbuf
->
len
=
0
;
/* force reader code to ignore buffer contents */
client
->
pos
=
0
;
connection_uses_tls
(
con
);
connection_queue_client
(
client
);
return
;
}
con
=
connection_create
(
con
->
sock
,
con
->
listensocket_real
,
con
->
listensocket_effective
,
strdup
(
con
->
ip
));
client
->
con
->
sock
=
-
1
;
/* TODO: do not use magic */
/* handle to keep the TLS connection */
...
...
@@ -199,9 +219,6 @@ static inline void client_reuseconnection(client_t *client) {
client
->
reuse
=
ICECAST_REUSE_CLOSE
;
client_destroy
(
client
);
if
(
reuse
==
ICECAST_REUSE_UPGRADETLS
)
connection_uses_tls
(
con
);
connection_queue
(
con
);
}
...
...
src/connection.c
View file @
143a8b71
...
...
@@ -1749,3 +1749,9 @@ void connection_close(connection_t *con)
refobject_unref
(
con
->
listensocket_effective
);
free
(
con
);
}
void
connection_queue_client
(
client_t
*
client
)
{
client_queue_t
*
node
=
create_client_node
(
client
);
_add_connection
(
node
);
}
src/connection.h
View file @
143a8b71
...
...
@@ -75,6 +75,7 @@ void connection_close(connection_t *con);
connection_t
*
connection_create
(
sock_t
sock
,
listensocket_t
*
listensocket_real
,
listensocket_t
*
listensocket_effective
,
char
*
ip
);
int
connection_complete_source
(
source_t
*
source
,
int
response
);
void
connection_queue
(
connection_t
*
con
);
void
connection_queue_client
(
client_t
*
client
);
void
connection_uses_tls
(
connection_t
*
con
);
ssize_t
connection_send_bytes
(
connection_t
*
con
,
const
void
*
buf
,
size_t
len
);
...
...
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