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
427dd816
Commit
427dd816
authored
Jun 04, 2009
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
client: added assertions on channel!=NULL
I'm hunting down a bug where client->channel==NULL during I/O operations. These new assertions help avoid this kind of bug in the future.
parent
ed475718
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
0 deletions
+10
-0
client.c
src/client.c
+10
-0
No files found.
src/client.c
View file @
427dd816
...
...
@@ -430,6 +430,9 @@ static int client_read(struct client *client)
GIOStatus
status
;
gsize
bytes_read
;
assert
(
client
!=
NULL
);
assert
(
client
->
channel
!=
NULL
);
p
=
fifo_buffer_write
(
client
->
input
,
&
max_length
);
if
(
p
==
NULL
)
{
g_warning
(
"[%u] buffer overflow"
,
client
->
num
);
...
...
@@ -617,6 +620,10 @@ client_write_deferred_buffer(struct client *client,
GIOStatus
status
;
gsize
bytes_written
;
assert
(
client
!=
NULL
);
assert
(
client
->
channel
!=
NULL
);
assert
(
buffer
!=
NULL
);
status
=
g_io_channel_write_chars
(
client
->
channel
,
buffer
->
data
,
buffer
->
size
,
&
bytes_written
,
&
error
);
...
...
@@ -723,6 +730,9 @@ static void client_write_direct(struct client *client,
GIOStatus
status
;
gsize
bytes_written
;
assert
(
client
!=
NULL
);
assert
(
client
->
channel
!=
NULL
);
assert
(
data
!=
NULL
);
assert
(
length
>
0
);
assert
(
g_queue_is_empty
(
client
->
deferred_send
));
...
...
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