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
7e16ac30
Commit
7e16ac30
authored
Nov 10, 2017
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
event/SocketMonitor: rename Get() to GetSocket()
parent
59a88369
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
12 additions
and
12 deletions
+12
-12
InotifySource.cxx
src/db/update/InotifySource.cxx
+3
-3
MultiSocketMonitor.hxx
src/event/MultiSocketMonitor.hxx
+3
-3
ServerSocket.cxx
src/event/ServerSocket.cxx
+1
-1
SocketMonitor.cxx
src/event/SocketMonitor.cxx
+2
-2
SocketMonitor.hxx
src/event/SocketMonitor.hxx
+1
-1
Global.cxx
src/lib/curl/Global.cxx
+1
-1
AvahiPoll.cxx
src/zeroconf/AvahiPoll.cxx
+1
-1
No files found.
src/db/update/InotifySource.cxx
View file @
7e16ac30
...
...
@@ -38,7 +38,7 @@ InotifySource::OnSocketReady(gcc_unused unsigned flags) noexcept
static_assert
(
sizeof
(
buffer
)
>=
sizeof
(
struct
inotify_event
)
+
NAME_MAX
+
1
,
"inotify buffer too small"
);
auto
ifd
=
Get
().
ToFileDescriptor
();
auto
ifd
=
Get
Socket
().
ToFileDescriptor
();
ssize_t
nbytes
=
ifd
.
Read
(
buffer
,
sizeof
(
buffer
));
if
(
nbytes
<
0
)
FatalSystemError
(
"Failed to read from inotify"
);
...
...
@@ -90,7 +90,7 @@ InotifySource::InotifySource(EventLoop &_loop,
int
InotifySource
::
Add
(
const
char
*
path_fs
,
unsigned
mask
)
{
auto
ifd
=
Get
().
ToFileDescriptor
();
auto
ifd
=
Get
Socket
().
ToFileDescriptor
();
int
wd
=
inotify_add_watch
(
ifd
.
Get
(),
path_fs
,
mask
);
if
(
wd
<
0
)
throw
MakeErrno
(
"inotify_add_watch() has failed"
);
...
...
@@ -101,7 +101,7 @@ InotifySource::Add(const char *path_fs, unsigned mask)
void
InotifySource
::
Remove
(
unsigned
wd
)
{
auto
ifd
=
Get
().
ToFileDescriptor
();
auto
ifd
=
Get
Socket
().
ToFileDescriptor
();
int
ret
=
inotify_rm_watch
(
ifd
.
Get
(),
wd
);
if
(
ret
<
0
&&
errno
!=
EINVAL
)
LogErrno
(
inotify_domain
,
"inotify_rm_watch() has failed"
);
...
...
src/event/MultiSocketMonitor.hxx
View file @
7e16ac30
...
...
@@ -58,8 +58,8 @@ class MultiSocketMonitor : IdleMonitor
Schedule
(
events
);
}
SocketDescriptor
Get
FD
()
const
{
return
SocketMonitor
::
Get
();
SocketDescriptor
Get
Socket
()
const
{
return
SocketMonitor
::
Get
Socket
();
}
unsigned
GetEvents
()
const
{
...
...
@@ -174,7 +174,7 @@ public:
i
!=
end
;
i
=
std
::
next
(
prev
))
{
assert
(
i
->
GetEvents
()
!=
0
);
unsigned
events
=
e
(
i
->
Get
FD
());
unsigned
events
=
e
(
i
->
Get
Socket
());
if
(
events
!=
0
)
{
i
->
SetEvents
(
events
);
prev
=
i
;
...
...
src/event/ServerSocket.cxx
View file @
7e16ac30
...
...
@@ -149,7 +149,7 @@ inline void
OneServerSocket
::
Accept
()
noexcept
{
StaticSocketAddress
peer_address
;
UniqueSocketDescriptor
peer_fd
(
Get
().
AcceptNonBlock
(
peer_address
));
UniqueSocketDescriptor
peer_fd
(
Get
Socket
().
AcceptNonBlock
(
peer_address
));
if
(
!
peer_fd
.
IsDefined
())
{
const
SocketErrorMessage
msg
;
FormatError
(
server_socket_domain
,
...
...
src/event/SocketMonitor.cxx
View file @
7e16ac30
...
...
@@ -106,7 +106,7 @@ SocketMonitor::Read(void *data, size_t length) noexcept
flags
|=
MSG_DONTWAIT
;
#endif
return
recv
(
Get
().
Get
(),
(
char
*
)
data
,
length
,
flags
);
return
recv
(
Get
Socket
().
Get
(),
(
char
*
)
data
,
length
,
flags
);
}
SocketMonitor
::
ssize_t
...
...
@@ -122,5 +122,5 @@ SocketMonitor::Write(const void *data, size_t length) noexcept
flags
|=
MSG_DONTWAIT
;
#endif
return
send
(
Get
().
Get
(),
(
const
char
*
)
data
,
length
,
flags
);
return
send
(
Get
Socket
().
Get
(),
(
const
char
*
)
data
,
length
,
flags
);
}
src/event/SocketMonitor.hxx
View file @
7e16ac30
...
...
@@ -77,7 +77,7 @@ public:
return
fd
.
IsDefined
();
}
SocketDescriptor
Get
()
const
noexcept
{
SocketDescriptor
Get
Socket
()
const
noexcept
{
assert
(
IsDefined
());
return
fd
;
...
...
src/lib/curl/Global.cxx
View file @
7e16ac30
...
...
@@ -149,7 +149,7 @@ CurlSocket::OnSocketReady(unsigned flags) noexcept
{
assert
(
GetEventLoop
().
IsInside
());
global
.
SocketAction
(
Get
().
Get
(),
FlagsToCurlCSelect
(
flags
));
global
.
SocketAction
(
Get
Socket
().
Get
(),
FlagsToCurlCSelect
(
flags
));
return
true
;
}
...
...
src/zeroconf/AvahiPoll.cxx
View file @
7e16ac30
...
...
@@ -73,7 +73,7 @@ private:
/* virtual methods from class SocketMonitor */
bool
OnSocketReady
(
unsigned
flags
)
noexcept
{
received
=
ToAvahiWatchEvent
(
flags
);
callback
(
this
,
Get
().
Get
(),
received
,
userdata
);
callback
(
this
,
Get
Socket
().
Get
(),
received
,
userdata
);
received
=
AvahiWatchEvent
(
0
);
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