Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
7c887af1
Commit
7c887af1
authored
Aug 23, 2011
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
output/httpd: add assertions
parent
b7f435b5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
1 deletion
+17
-1
httpd_client.c
src/output/httpd_client.c
+17
-1
No files found.
src/output/httpd_client.c
View file @
7c887af1
...
...
@@ -143,6 +143,8 @@ httpd_client_unref_page(gpointer data, G_GNUC_UNUSED gpointer user_data)
void
httpd_client_free
(
struct
httpd_client
*
client
)
{
assert
(
client
!=
NULL
);
if
(
client
->
state
==
RESPONSE
)
{
if
(
client
->
write_source_id
!=
0
)
g_source_remove
(
client
->
write_source_id
);
...
...
@@ -169,6 +171,8 @@ httpd_client_free(struct httpd_client *client)
static
void
httpd_client_close
(
struct
httpd_client
*
client
)
{
assert
(
client
!=
NULL
);
httpd_output_remove_client
(
client
->
httpd
,
client
);
httpd_client_free
(
client
);
}
...
...
@@ -179,6 +183,9 @@ httpd_client_close(struct httpd_client *client)
static
void
httpd_client_begin_response
(
struct
httpd_client
*
client
)
{
assert
(
client
!=
NULL
);
assert
(
client
->
state
!=
RESPONSE
);
client
->
state
=
RESPONSE
;
client
->
write_source_id
=
0
;
client
->
pages
=
g_queue_new
();
...
...
@@ -239,6 +246,9 @@ httpd_client_handle_line(struct httpd_client *client, const char *line)
static
char
*
httpd_client_read_line
(
struct
httpd_client
*
client
)
{
assert
(
client
!=
NULL
);
assert
(
client
->
state
!=
RESPONSE
);
const
char
*
p
,
*
newline
;
size_t
length
;
char
*
line
;
...
...
@@ -271,6 +281,7 @@ httpd_client_send_response(struct httpd_client *client)
GIOStatus
status
;
gsize
bytes_written
;
assert
(
client
!=
NULL
);
assert
(
client
->
state
==
RESPONSE
);
if
(
!
client
->
metadata_requested
)
{
...
...
@@ -334,14 +345,19 @@ httpd_client_send_response(struct httpd_client *client)
static
bool
httpd_client_received
(
struct
httpd_client
*
client
)
{
assert
(
client
!=
NULL
);
assert
(
client
->
state
!=
RESPONSE
);
char
*
line
;
bool
success
;
while
((
line
=
httpd_client_read_line
(
client
))
!=
NULL
)
{
success
=
httpd_client_handle_line
(
client
,
line
);
g_free
(
line
);
if
(
!
success
)
if
(
!
success
)
{
assert
(
client
->
state
!=
RESPONSE
);
return
false
;
}
if
(
client
->
state
==
RESPONSE
)
{
if
(
!
fifo_buffer_is_empty
(
client
->
input
))
{
...
...
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