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
6cce3d29
Commit
6cce3d29
authored
Aug 06, 2015
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ClientWrite: merge client_write() into Client::Write()
parent
77b34fa9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
12 deletions
+6
-12
Client.hxx
src/client/Client.hxx
+1
-1
ClientWrite.cxx
src/client/ClientWrite.cxx
+5
-11
No files found.
src/client/Client.hxx
View file @
6cce3d29
...
...
@@ -112,7 +112,7 @@ public:
void
Close
();
void
SetExpired
();
using
FullyBufferedSocket
::
Write
;
bool
Write
(
const
void
*
data
,
size_t
length
)
;
/**
* returns the uid of the client process, or a negative value
...
...
src/client/ClientWrite.cxx
View file @
6cce3d29
...
...
@@ -23,30 +23,24 @@
#include <string.h>
/**
* Write a block of data to the client.
*/
static
void
client_write
(
Client
&
client
,
const
char
*
data
,
size_t
length
)
bool
Client
::
Write
(
const
void
*
data
,
size_t
length
)
{
/* if the client is going to be closed, do nothing */
if
(
client
.
IsExpired
()
||
length
==
0
)
return
;
client
.
Write
(
data
,
length
);
return
!
IsExpired
()
&&
FullyBufferedSocket
::
Write
(
data
,
length
);
}
void
client_puts
(
Client
&
client
,
const
char
*
s
)
{
client
_write
(
client
,
s
,
strlen
(
s
));
client
.
Write
(
s
,
strlen
(
s
));
}
void
client_vprintf
(
Client
&
client
,
const
char
*
fmt
,
va_list
args
)
{
char
*
p
=
FormatNewV
(
fmt
,
args
);
client
_write
(
client
,
p
,
strlen
(
p
));
client
.
Write
(
p
,
strlen
(
p
));
delete
[]
p
;
}
...
...
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