Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
chat
RocketChatMobilePushGateway
Commits
c43b233d
Commit
c43b233d
authored
Apr 22, 2019
by
armin
Browse files
mend
parent
7ad9a5f9
Changes
4
Hide whitespace changes
Inline
Side-by-side
Dockerfile
View file @
c43b233d
...
...
@@ -7,7 +7,7 @@ ADD . /pushGateway/RocketChatMobilePushGateway
RUN
cd
/pushGateway/RocketChatMobilePushGateway
\
&&
cmake
.
\
&&
make
\
&&
make
-j
$[
$(
nproc
)
+ 1]
\
&&
rm
CMake
*
-rf
\
&&
rm
cmake
*
-rf
...
...
handlers/ApplePushHandler.cpp
View file @
c43b233d
...
...
@@ -56,7 +56,7 @@ void ApplePushHandler::onEOM() noexcept {
if
(
forwardModel
.
forwardMessage
(
std
::
move
(
mHeaders
),
body
)){
ResponseBuilder
(
downstream_
).
status
(
200
,
"OK"
).
body
(
""
).
sendWithEOM
();
}
else
{
ResponseBuilder
(
downstream_
).
status
(
500
,
"FAILURE"
).
body
(
"failed to send push message"
).
sendWithEOM
();
ResponseBuilder
(
downstream_
).
status
(
500
,
"FAILURE"
).
body
(
"failed to send push message
through forwardgateway
"
).
sendWithEOM
();
}
}
else
{
...
...
handlers/GooglePushHandler.cpp
View file @
c43b233d
...
...
@@ -54,7 +54,7 @@ void GooglePushHandler::onEOM() noexcept {
if
(
forwardModel
.
forwardMessage
(
std
::
move
(
mHeaders
),
body
)){
ResponseBuilder
(
downstream_
).
status
(
200
,
"OK"
).
body
(
""
).
sendWithEOM
();
}
else
{
ResponseBuilder
(
downstream_
).
status
(
500
,
"FAILURE"
).
body
(
"failed to send push message"
).
sendWithEOM
();
ResponseBuilder
(
downstream_
).
status
(
500
,
"FAILURE"
).
body
(
"failed to send push message
through forwardgateway
"
).
sendWithEOM
();
}
}
else
{
ResponseBuilder
(
downstream_
).
status
(
500
,
"FAILURE"
).
body
(
"failed to send push message"
).
sendWithEOM
();
...
...
models/ForwardGatewayModel.cpp
View file @
c43b233d
...
...
@@ -33,7 +33,6 @@ size_t ForwardGatewayModel::curlWriteCallback(void *buffer, size_t size, size_t
if
(
buffer
!=
nullptr
)
{
std
::
string
bufferString
(
static_cast
<
char
*>
(
buffer
),
nmemb
);
LOG
(
ERROR
)
<<
"forwardgateway error response: "
<<
bufferString
;
LOG
(
ERROR
)
<<
"failed message: "
<<
reinterpret_cast
<
const
char
*>
(
this_ptr
);
return
0
;
}
return
1
;
...
...
@@ -63,7 +62,6 @@ bool ForwardGatewayModel::forwardMessage(std::unique_ptr<HTTPMessage> pHeaders,
curl_easy_setopt
(
curl
,
CURLOPT_SSL_VERIFYPEER
,
false
);
curl_easy_setopt
(
curl
,
CURLOPT_TCP_KEEPALIVE
,
true
);
curl_easy_setopt
(
curl
,
CURLOPT_WRITEFUNCTION
,
curlWriteCallback
);
curl_easy_setopt
(
curl
,
CURLOPT_WRITEDATA
,
pBody
.
c_str
());
res
=
curl_easy_perform
(
curl
);
...
...
Write
Preview
Supports
Markdown
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