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
a17a481e
Commit
a17a481e
authored
7 years ago
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
event/BufferedSocket: add "noexcept"
parent
5f9d4a02
sisyphus
0.23.15-alt1
0.23.14-alt1
0.23.13-alt1
0.23.12-alt1
0.23.11-alt1
0.23.8-alt3
0.23.8-alt2
0.23.8-alt1
0.21.24-alt1.1
0.21.24-alt1
gb-sisyphus-task339776.6100
gb-sisyphus-task337393.100
gb-sisyphus-task337176.300
gb-sisyphus-task334590.100
gb-sisyphus-task333607.100
gb-sisyphus-task331543.2500
gb-sisyphus-task328663.4700
gb-sisyphus-task325064.100
gb-sisyphus-task319111.4000
gb-sisyphus-task313704.100
gb-sisyphus-task312885.100
gb-sisyphus-task308905.3200
gb-sisyphus-task305294.500
gb-sisyphus-task304007.100
gb-sisyphus-task303674.1700
gb-sisyphus-task298681.300
gb-sisyphus-task296051.1000
gb-sisyphus-task274827.100
gb-sisyphus-task269249.2000
gb-sisyphus-task266579.400
gb-sisyphus-task258132.600
gb-sisyphus-task254601.200
No related merge requests found
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
23 additions
and
23 deletions
+23
-23
Client.hxx
src/client/Client.hxx
+3
-3
ClientEvent.cxx
src/client/ClientEvent.cxx
+2
-2
ClientRead.cxx
src/client/ClientRead.cxx
+1
-1
BufferedSocket.cxx
src/event/BufferedSocket.cxx
+3
-3
BufferedSocket.hxx
src/event/BufferedSocket.hxx
+8
-8
HttpdClient.cxx
src/output/plugins/httpd/HttpdClient.cxx
+3
-3
HttpdClient.hxx
src/output/plugins/httpd/HttpdClient.hxx
+3
-3
No files found.
src/client/Client.hxx
View file @
a17a481e
...
@@ -226,9 +226,9 @@ public:
...
@@ -226,9 +226,9 @@ public:
private
:
private
:
/* virtual methods from class BufferedSocket */
/* virtual methods from class BufferedSocket */
InputResult
OnSocketInput
(
void
*
data
,
size_t
length
)
override
;
InputResult
OnSocketInput
(
void
*
data
,
size_t
length
)
noexcept
override
;
void
OnSocketError
(
std
::
exception_ptr
ep
)
override
;
void
OnSocketError
(
std
::
exception_ptr
ep
)
noexcept
override
;
void
OnSocketClosed
()
override
;
void
OnSocketClosed
()
noexcept
override
;
/* callback for TimerEvent */
/* callback for TimerEvent */
void
OnTimeout
()
noexcept
;
void
OnTimeout
()
noexcept
;
...
...
This diff is collapsed.
Click to expand it.
src/client/ClientEvent.cxx
View file @
a17a481e
...
@@ -22,7 +22,7 @@
...
@@ -22,7 +22,7 @@
#include "Log.hxx"
#include "Log.hxx"
void
void
Client
::
OnSocketError
(
std
::
exception_ptr
ep
)
Client
::
OnSocketError
(
std
::
exception_ptr
ep
)
noexcept
{
{
FormatError
(
ep
,
"error on client %d"
,
num
);
FormatError
(
ep
,
"error on client %d"
,
num
);
...
@@ -30,7 +30,7 @@ Client::OnSocketError(std::exception_ptr ep)
...
@@ -30,7 +30,7 @@ Client::OnSocketError(std::exception_ptr ep)
}
}
void
void
Client
::
OnSocketClosed
()
Client
::
OnSocketClosed
()
noexcept
{
{
SetExpired
();
SetExpired
();
}
}
This diff is collapsed.
Click to expand it.
src/client/ClientRead.cxx
View file @
a17a481e
...
@@ -27,7 +27,7 @@
...
@@ -27,7 +27,7 @@
#include <string.h>
#include <string.h>
BufferedSocket
::
InputResult
BufferedSocket
::
InputResult
Client
::
OnSocketInput
(
void
*
data
,
size_t
length
)
Client
::
OnSocketInput
(
void
*
data
,
size_t
length
)
noexcept
{
{
char
*
p
=
(
char
*
)
data
;
char
*
p
=
(
char
*
)
data
;
char
*
newline
=
(
char
*
)
memchr
(
p
,
'\n'
,
length
);
char
*
newline
=
(
char
*
)
memchr
(
p
,
'\n'
,
length
);
...
...
This diff is collapsed.
Click to expand it.
src/event/BufferedSocket.cxx
View file @
a17a481e
...
@@ -25,7 +25,7 @@
...
@@ -25,7 +25,7 @@
#include <algorithm>
#include <algorithm>
BufferedSocket
::
ssize_t
BufferedSocket
::
ssize_t
BufferedSocket
::
DirectRead
(
void
*
data
,
size_t
length
)
BufferedSocket
::
DirectRead
(
void
*
data
,
size_t
length
)
noexcept
{
{
const
auto
nbytes
=
GetSocket
().
Read
((
char
*
)
data
,
length
);
const
auto
nbytes
=
GetSocket
().
Read
((
char
*
)
data
,
length
);
if
(
gcc_likely
(
nbytes
>
0
))
if
(
gcc_likely
(
nbytes
>
0
))
...
@@ -48,7 +48,7 @@ BufferedSocket::DirectRead(void *data, size_t length)
...
@@ -48,7 +48,7 @@ BufferedSocket::DirectRead(void *data, size_t length)
}
}
bool
bool
BufferedSocket
::
ReadToBuffer
()
BufferedSocket
::
ReadToBuffer
()
noexcept
{
{
assert
(
IsDefined
());
assert
(
IsDefined
());
...
@@ -63,7 +63,7 @@ BufferedSocket::ReadToBuffer()
...
@@ -63,7 +63,7 @@ BufferedSocket::ReadToBuffer()
}
}
bool
bool
BufferedSocket
::
ResumeInput
()
BufferedSocket
::
ResumeInput
()
noexcept
{
{
assert
(
IsDefined
());
assert
(
IsDefined
());
...
...
This diff is collapsed.
Click to expand it.
src/event/BufferedSocket.hxx
View file @
a17a481e
...
@@ -38,7 +38,7 @@ class BufferedSocket : protected SocketMonitor {
...
@@ -38,7 +38,7 @@ class BufferedSocket : protected SocketMonitor {
StaticFifoBuffer
<
uint8_t
,
8192
>
input
;
StaticFifoBuffer
<
uint8_t
,
8192
>
input
;
public
:
public
:
BufferedSocket
(
SocketDescriptor
_fd
,
EventLoop
&
_loop
)
BufferedSocket
(
SocketDescriptor
_fd
,
EventLoop
&
_loop
)
noexcept
:
SocketMonitor
(
_fd
,
_loop
)
{
:
SocketMonitor
(
_fd
,
_loop
)
{
ScheduleRead
();
ScheduleRead
();
}
}
...
@@ -47,20 +47,20 @@ public:
...
@@ -47,20 +47,20 @@ public:
using
SocketMonitor
::
Close
;
using
SocketMonitor
::
Close
;
private
:
private
:
ssize_t
DirectRead
(
void
*
data
,
size_t
length
);
ssize_t
DirectRead
(
void
*
data
,
size_t
length
)
noexcept
;
/**
/**
* Receive data from the socket to the input buffer.
* Receive data from the socket to the input buffer.
*
*
* @return false if the socket has been closed
* @return false if the socket has been closed
*/
*/
bool
ReadToBuffer
();
bool
ReadToBuffer
()
noexcept
;
protected
:
protected
:
/**
/**
* @return false if the socket has been closed
* @return false if the socket has been closed
*/
*/
bool
ResumeInput
();
bool
ResumeInput
()
noexcept
;
/**
/**
* Mark a portion of the input buffer "consumed". Only
* Mark a portion of the input buffer "consumed". Only
...
@@ -68,7 +68,7 @@ protected:
...
@@ -68,7 +68,7 @@ protected:
* does not invalidate the pointer passed to OnSocketInput()
* does not invalidate the pointer passed to OnSocketInput()
* yet.
* yet.
*/
*/
void
ConsumeInput
(
size_t
nbytes
)
{
void
ConsumeInput
(
size_t
nbytes
)
noexcept
{
assert
(
IsDefined
());
assert
(
IsDefined
());
input
.
Consume
(
nbytes
);
input
.
Consume
(
nbytes
);
...
@@ -107,10 +107,10 @@ protected:
...
@@ -107,10 +107,10 @@ protected:
* buffer may be modified by the method while it processes the
* buffer may be modified by the method while it processes the
* data
* data
*/
*/
virtual
InputResult
OnSocketInput
(
void
*
data
,
size_t
length
)
=
0
;
virtual
InputResult
OnSocketInput
(
void
*
data
,
size_t
length
)
noexcept
=
0
;
virtual
void
OnSocketError
(
std
::
exception_ptr
ep
)
=
0
;
virtual
void
OnSocketError
(
std
::
exception_ptr
ep
)
noexcept
=
0
;
virtual
void
OnSocketClosed
()
=
0
;
virtual
void
OnSocketClosed
()
noexcept
=
0
;
/* virtual methods from class SocketMonitor */
/* virtual methods from class SocketMonitor */
bool
OnSocketReady
(
unsigned
flags
)
noexcept
override
;
bool
OnSocketReady
(
unsigned
flags
)
noexcept
override
;
...
...
This diff is collapsed.
Click to expand it.
src/output/plugins/httpd/HttpdClient.cxx
View file @
a17a481e
...
@@ -408,7 +408,7 @@ HttpdClient::OnSocketReady(unsigned flags) noexcept
...
@@ -408,7 +408,7 @@ HttpdClient::OnSocketReady(unsigned flags) noexcept
}
}
BufferedSocket
::
InputResult
BufferedSocket
::
InputResult
HttpdClient
::
OnSocketInput
(
void
*
data
,
size_t
length
)
HttpdClient
::
OnSocketInput
(
void
*
data
,
size_t
length
)
noexcept
{
{
if
(
state
==
State
::
RESPONSE
)
{
if
(
state
==
State
::
RESPONSE
)
{
LogWarning
(
httpd_output_domain
,
LogWarning
(
httpd_output_domain
,
...
@@ -449,13 +449,13 @@ HttpdClient::OnSocketInput(void *data, size_t length)
...
@@ -449,13 +449,13 @@ HttpdClient::OnSocketInput(void *data, size_t length)
}
}
void
void
HttpdClient
::
OnSocketError
(
std
::
exception_ptr
ep
)
HttpdClient
::
OnSocketError
(
std
::
exception_ptr
ep
)
noexcept
{
{
LogError
(
ep
);
LogError
(
ep
);
}
}
void
void
HttpdClient
::
OnSocketClosed
()
HttpdClient
::
OnSocketClosed
()
noexcept
{
{
LockClose
();
LockClose
();
}
}
This diff is collapsed.
Click to expand it.
src/output/plugins/httpd/HttpdClient.hxx
View file @
a17a481e
...
@@ -194,9 +194,9 @@ protected:
...
@@ -194,9 +194,9 @@ protected:
/* virtual methods from class SocketMonitor */
/* virtual methods from class SocketMonitor */
bool
OnSocketReady
(
unsigned
flags
)
noexcept
override
;
bool
OnSocketReady
(
unsigned
flags
)
noexcept
override
;
virtual
InputResult
OnSocketInput
(
void
*
data
,
size_t
length
)
override
;
InputResult
OnSocketInput
(
void
*
data
,
size_t
length
)
noexcept
override
;
void
OnSocketError
(
std
::
exception_ptr
ep
)
override
;
void
OnSocketError
(
std
::
exception_ptr
ep
)
noexcept
override
;
v
irtual
void
OnSocketClosed
()
override
;
v
oid
OnSocketClosed
()
noexcept
override
;
};
};
#endif
#endif
This diff is collapsed.
Click to expand it.
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