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
fd5d4283
Commit
fd5d4283
authored
Apr 12, 2016
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Client: add WriteString()
parent
4eaa82fd
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
5 deletions
+14
-5
Client.hxx
src/client/Client.hxx
+5
-0
ClientWrite.cxx
src/client/ClientWrite.cxx
+8
-2
Response.cxx
src/client/Response.cxx
+1
-3
No files found.
src/client/Client.hxx
View file @
fd5d4283
...
...
@@ -110,6 +110,11 @@ public:
bool
Write
(
const
void
*
data
,
size_t
length
);
/**
* Write a null-terminated string.
*/
bool
Write
(
const
char
*
data
);
/**
* returns the uid of the client process, or a negative value
* if the uid is unknown
*/
...
...
src/client/ClientWrite.cxx
View file @
fd5d4283
...
...
@@ -30,17 +30,23 @@ Client::Write(const void *data, size_t length)
return
!
IsExpired
()
&&
FullyBufferedSocket
::
Write
(
data
,
length
);
}
bool
Client
::
Write
(
const
char
*
data
)
{
return
Write
(
data
,
strlen
(
data
));
}
void
client_puts
(
Client
&
client
,
const
char
*
s
)
{
client
.
Write
(
s
,
strlen
(
s
)
);
client
.
Write
(
s
);
}
void
client_vprintf
(
Client
&
client
,
const
char
*
fmt
,
va_list
args
)
{
char
*
p
=
FormatNewV
(
fmt
,
args
);
client
.
Write
(
p
,
strlen
(
p
)
);
client
.
Write
(
p
);
delete
[]
p
;
}
...
...
src/client/Response.cxx
View file @
fd5d4283
...
...
@@ -22,8 +22,6 @@
#include "Client.hxx"
#include "util/FormatString.hxx"
#include <string.h>
bool
Response
::
Write
(
const
void
*
data
,
size_t
length
)
{
...
...
@@ -33,7 +31,7 @@ Response::Write(const void *data, size_t length)
bool
Response
::
Write
(
const
char
*
data
)
{
return
Write
(
data
,
strlen
(
data
)
);
return
client
.
Write
(
data
);
}
bool
...
...
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