Skip to content
This repository has been archived by the owner on Aug 2, 2020. It is now read-only.

Commit

Permalink
Bump to v4.4.0-beta.2
Browse files Browse the repository at this point in the history
  • Loading branch information
stdrc committed Aug 8, 2018
1 parent d7c9f57 commit 5cbe3f3
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 10 deletions.
4 changes: 2 additions & 2 deletions io.github.richardchien.coolqhttpapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"ret": 1,
"apiver": 9,
"name": "HTTP API",
"version": "4.4.0-beta.1",
"version_id": 416,
"version": "4.4.0-beta.2",
"version_id": 417,
"author": "Richard Chien",
"description": "通过 HTTP 或 WebSocket 对酷 Q 的事件进行上报以及接收请求来调用酷 Q 的 DLL 接口,从而可以使用其它语言编写酷 Q 插件。具体见 https://github.com/richardchien/coolq-http-api",
"event": [
Expand Down
4 changes: 2 additions & 2 deletions src/cqhttp/core/def.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#define CQHTTP_ID "io.github.richardchien.coolqhttpapi"
#define CQHTTP_NAME "CoolQ HTTP API"

#define CQHTTP_BUILD_NUMBER 416
#define CQHTTP_BUILD_NUMBER 417

#define _CQHTTP_TO_STR(x) #x
#define CQHTTP_TO_STR(x) _CQHTTP_TO_STR(x)
Expand All @@ -16,7 +16,7 @@
#define CQHTTP_VERSION_MINOR 4
#define CQHTTP_VERSION_PATCH 0
#define CQHTTP_VERSION_PRE _CQHTTP_BETA
#define CQHTTP_VERSION_PRE_VER 1
#define CQHTTP_VERSION_PRE_VER 2

#if CQHTTP_VERSION_PRE == _CQHTTP_ALPHA
#define CQHTTP_VERSION_PRE_S "alpha"
Expand Down
17 changes: 11 additions & 6 deletions src/cqhttp/plugins/web/websocket_reverse_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,16 @@ namespace cqhttp::plugins {
if (!access_token_.empty()) {
client->config.header.emplace("Authorization", "Token " + access_token_);
}
client->on_close = [&](shared_ptr<typename WsClientT::Connection> connection, const int code, string reason) {
if (reconnect_on_code_1000_ || code != 1000) {
notify_should_reconnect();
}
};
client->on_error = [&](shared_ptr<typename WsClientT::Connection>, const SimpleWeb::error_code &) {
client->on_close =
[&](shared_ptr<typename WsClientT::Connection> connection, const int code, const string &reason) {
if (reconnect_on_code_1000_ || code != 1000) {
logging::debug(TAG,
u8"反向 WebSocket 连接断开,close code: " + to_string(code) + ",reason:" + reason);
notify_should_reconnect();
}
};
client->on_error = [&](shared_ptr<typename WsClientT::Connection>, const SimpleWeb::error_code &e) {
logging::debug(TAG, u8"反向 WebSocket 连接发生错误,error code: " + to_string(e.value()));
notify_should_reconnect();
};
return client;
Expand Down Expand Up @@ -59,6 +63,7 @@ namespace cqhttp::plugins {
client_.wss->start();
}
} catch (...) {
logging::debug(TAG, u8"反向 WebSocket 建立连接失败");
notify_should_reconnect();
}
started_ = false;
Expand Down

0 comments on commit 5cbe3f3

Please sign in to comment.