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
cbb595ba
Commit
cbb595ba
authored
Jul 22, 2015
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
event/ServerSocket: use AllocatedSocketAddress to build local socket address
parent
fdeec030
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
13 deletions
+4
-13
ServerSocket.cxx
src/event/ServerSocket.cxx
+4
-13
No files found.
src/event/ServerSocket.cxx
View file @
cbb595ba
...
...
@@ -429,21 +429,12 @@ bool
ServerSocket
::
AddPath
(
AllocatedPath
&&
path
,
Error
&
error
)
{
#ifdef HAVE_UN
struct
sockaddr_un
s_un
;
(
void
)
error
;
const
size_t
path_length
=
path
.
length
();
if
(
path_length
>=
sizeof
(
s_un
.
sun_path
))
{
error
.
Set
(
server_socket_domain
,
"UNIX socket path is too long"
);
return
false
;
}
RemoveFile
(
path
);
s_un
.
sun_family
=
AF_UNIX
;
memcpy
(
s_un
.
sun_path
,
path
.
c_str
(),
path_length
+
1
);
AllocatedSocketAddress
address
;
address
.
SetLocal
(
path
.
c_str
());
OneServerSocket
&
s
=
AddAddress
(
{(
const
sockaddr
*
)
&
s_un
,
sizeof
(
s_un
)}
);
OneServerSocket
&
s
=
AddAddress
(
std
::
move
(
address
)
);
s
.
SetPath
(
std
::
move
(
path
));
return
true
;
...
...
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