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
32bb19d0
Commit
32bb19d0
authored
Aug 28, 2008
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
client: use client_defer_output() in client_write()
Eliminate duplicated code, call client_defer_output() which we splitted from client_write_output() earlier.
parent
709b795e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
7 deletions
+3
-7
client.c
src/client.c
+3
-7
No files found.
src/client.c
View file @
32bb19d0
...
@@ -753,22 +753,18 @@ static void client_write(struct client *client,
...
@@ -753,22 +753,18 @@ static void client_write(struct client *client,
if
((
ret
=
write
(
client
->
fd
,
data
,
length
))
<
0
)
{
if
((
ret
=
write
(
client
->
fd
,
data
,
length
))
<
0
)
{
if
(
errno
==
EAGAIN
||
errno
==
EINTR
)
{
if
(
errno
==
EAGAIN
||
errno
==
EINTR
)
{
client
->
deferred_send
=
new_sllnode
(
data
,
length
);
client
_defer_output
(
client
,
data
,
length
);
}
else
{
}
else
{
DEBUG
(
"client %i: problems writing
\n
"
,
client
->
num
);
DEBUG
(
"client %i: problems writing
\n
"
,
client
->
num
);
client
->
expired
=
1
;
client
->
expired
=
1
;
return
;
return
;
}
}
}
else
if
((
size_t
)
ret
<
client
->
send_buf_used
)
{
}
else
if
((
size_t
)
ret
<
client
->
send_buf_used
)
{
client
->
deferred_send
=
new_sllnode
(
data
+
ret
,
length
-
ret
);
client
_defer_output
(
client
,
data
+
ret
,
length
-
ret
);
}
}
if
(
client
->
deferred_send
)
{
if
(
client
->
deferred_send
)
DEBUG
(
"client %i: buffer created
\n
"
,
client
->
num
);
DEBUG
(
"client %i: buffer created
\n
"
,
client
->
num
);
client
->
deferred_bytes
=
client
->
deferred_send
->
size
+
sizeof
(
struct
sllnode
);
}
}
}
static
void
client_write_output
(
struct
client
*
client
)
static
void
client_write_output
(
struct
client
*
client
)
...
...
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