Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
Root
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
为了安全,强烈建议开启2FA双因子认证:User Settings -> Account -> Enable two-factor authentication!!!
Show more breadcrumbs
cxwx
Root
Commits
5f7bd068
Commit
5f7bd068
authored
6 years ago
by
Sergey Linev
Committed by
Philippe Canal
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
http: use override and remove virtual keywords
parent
1b08833e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
net/http/src/TCivetweb.cxx
+7
-7
7 additions, 7 deletions
net/http/src/TCivetweb.cxx
net/http/src/THttpLongPollEngine.h
+7
-7
7 additions, 7 deletions
net/http/src/THttpLongPollEngine.h
net/http/src/THttpWSEngine.h
+2
-2
2 additions, 2 deletions
net/http/src/THttpWSEngine.h
with
16 additions
and
16 deletions
net/http/src/TCivetweb.cxx
+
7
−
7
View file @
5f7bd068
...
...
@@ -33,23 +33,23 @@ protected:
struct
mg_connection
*
fWSconn
;
/// True websocket requires extra thread to parallelize sending
virtual
Bool_t
SupportSendThrd
()
const
{
return
kTRUE
;
}
Bool_t
SupportSendThrd
()
const
override
{
return
kTRUE
;
}
public
:
TCivetwebWSEngine
(
struct
mg_connection
*
conn
)
:
THttpWSEngine
(),
fWSconn
(
conn
)
{}
virtual
~
TCivetwebWSEngine
()
{}
virtual
~
TCivetwebWSEngine
()
=
default
;
virtual
UInt_t
GetId
()
const
{
return
TString
::
Hash
((
void
*
)
&
fWSconn
,
sizeof
(
void
*
));
}
UInt_t
GetId
()
const
override
{
return
TString
::
Hash
((
void
*
)
&
fWSconn
,
sizeof
(
void
*
));
}
virtual
void
ClearHandle
(
Bool_t
terminate
)
override
void
ClearHandle
(
Bool_t
terminate
)
override
{
if
(
fWSconn
&&
terminate
)
mg_websocket_write
(
fWSconn
,
MG_WEBSOCKET_OPCODE_CONNECTION_CLOSE
,
nullptr
,
0
);
fWSconn
=
nullptr
;
}
virtual
void
Send
(
const
void
*
buf
,
int
len
)
void
Send
(
const
void
*
buf
,
int
len
)
override
{
if
(
fWSconn
)
mg_websocket_write
(
fWSconn
,
MG_WEBSOCKET_OPCODE_BINARY
,
(
const
char
*
)
buf
,
len
);
...
...
@@ -59,7 +59,7 @@ public:
/// Special method to send binary data with text header
/// For normal websocket it is two separated operation, for other engines could be combined together,
/// but emulates as two messages on client side
virtual
void
SendHeader
(
const
char
*
hdr
,
const
void
*
buf
,
int
len
)
void
SendHeader
(
const
char
*
hdr
,
const
void
*
buf
,
int
len
)
override
{
if
(
fWSconn
)
{
mg_websocket_write
(
fWSconn
,
MG_WEBSOCKET_OPCODE_TEXT
,
hdr
,
strlen
(
hdr
));
...
...
@@ -67,7 +67,7 @@ public:
}
}
virtual
void
SendCharStar
(
const
char
*
str
)
void
SendCharStar
(
const
char
*
str
)
override
{
if
(
fWSconn
)
mg_websocket_write
(
fWSconn
,
MG_WEBSOCKET_OPCODE_TEXT
,
str
,
strlen
(
str
));
...
...
This diff is collapsed.
Click to expand it.
net/http/src/THttpLongPollEngine.h
+
7
−
7
View file @
5f7bd068
...
...
@@ -38,19 +38,19 @@ public:
THttpLongPollEngine
(
bool
raw
=
false
);
virtual
~
THttpLongPollEngine
();
virtual
UInt_t
GetId
()
const
override
;
UInt_t
GetId
()
const
override
;
virtual
void
ClearHandle
(
Bool_t
)
override
;
void
ClearHandle
(
Bool_t
)
override
;
virtual
void
Send
(
const
void
*
buf
,
int
len
)
override
;
void
Send
(
const
void
*
buf
,
int
len
)
override
;
virtual
void
SendCharStar
(
const
char
*
buf
)
override
;
void
SendCharStar
(
const
char
*
buf
)
override
;
virtual
void
SendHeader
(
const
char
*
hdr
,
const
void
*
buf
,
int
len
)
override
;
void
SendHeader
(
const
char
*
hdr
,
const
void
*
buf
,
int
len
)
override
;
virtual
Bool_t
PreProcess
(
std
::
shared_ptr
<
THttpCallArg
>
&
arg
)
override
;
Bool_t
PreProcess
(
std
::
shared_ptr
<
THttpCallArg
>
&
arg
)
override
;
virtual
void
PostProcess
(
std
::
shared_ptr
<
THttpCallArg
>
&
arg
)
override
;
void
PostProcess
(
std
::
shared_ptr
<
THttpCallArg
>
&
arg
)
override
;
};
#endif
This diff is collapsed.
Click to expand it.
net/http/src/THttpWSEngine.h
+
2
−
2
View file @
5f7bd068
...
...
@@ -33,10 +33,10 @@ private:
std
::
thread
fSendThrd
;
///<! dedicated thread for all send operations
bool
fHasSendThrd
{
false
};
///<! if any special thread was started
std
::
mutex
fCondMutex
;
///<! mutex used to access
a
condition
std
::
mutex
fCondMutex
;
///<! mutex used to access condition
std
::
condition_variable
fCond
;
///<! condition used to sync with sending thread
std
::
mutex
fDataMutex
;
///<! protects data submited for send operation
std
::
mutex
fDataMutex
;
///<! protects data submit
t
ed for send operation
enum
{
kNone
,
kData
,
kHeader
,
kText
}
fKind
{
kNone
};
///<! kind of operation
bool
fDoingSend
{
false
};
///<! doing send operation in other thread
std
::
string
fData
;
///<! data (binary or text)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment