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

Commit 5cbe3f3

Browse files
committed
Bump to v4.4.0-beta.2
1 parent d7c9f57 commit 5cbe3f3

File tree

3 files changed

+15
-10
lines changed

3 files changed

+15
-10
lines changed

io.github.richardchien.coolqhttpapi.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
"ret": 1,
33
"apiver": 9,
44
"name": "HTTP API",
5-
"version": "4.4.0-beta.1",
6-
"version_id": 416,
5+
"version": "4.4.0-beta.2",
6+
"version_id": 417,
77
"author": "Richard Chien",
88
"description": "通过 HTTP 或 WebSocket 对酷 Q 的事件进行上报以及接收请求来调用酷 Q 的 DLL 接口,从而可以使用其它语言编写酷 Q 插件。具体见 https://github.com/richardchien/coolq-http-api",
99
"event": [

src/cqhttp/core/def.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#define CQHTTP_ID "io.github.richardchien.coolqhttpapi"
44
#define CQHTTP_NAME "CoolQ HTTP API"
55

6-
#define CQHTTP_BUILD_NUMBER 416
6+
#define CQHTTP_BUILD_NUMBER 417
77

88
#define _CQHTTP_TO_STR(x) #x
99
#define CQHTTP_TO_STR(x) _CQHTTP_TO_STR(x)
@@ -16,7 +16,7 @@
1616
#define CQHTTP_VERSION_MINOR 4
1717
#define CQHTTP_VERSION_PATCH 0
1818
#define CQHTTP_VERSION_PRE _CQHTTP_BETA
19-
#define CQHTTP_VERSION_PRE_VER 1
19+
#define CQHTTP_VERSION_PRE_VER 2
2020

2121
#if CQHTTP_VERSION_PRE == _CQHTTP_ALPHA
2222
#define CQHTTP_VERSION_PRE_S "alpha"

src/cqhttp/plugins/web/websocket_reverse_client.cpp

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,16 @@ namespace cqhttp::plugins {
2121
if (!access_token_.empty()) {
2222
client->config.header.emplace("Authorization", "Token " + access_token_);
2323
}
24-
client->on_close = [&](shared_ptr<typename WsClientT::Connection> connection, const int code, string reason) {
25-
if (reconnect_on_code_1000_ || code != 1000) {
26-
notify_should_reconnect();
27-
}
28-
};
29-
client->on_error = [&](shared_ptr<typename WsClientT::Connection>, const SimpleWeb::error_code &) {
24+
client->on_close =
25+
[&](shared_ptr<typename WsClientT::Connection> connection, const int code, const string &reason) {
26+
if (reconnect_on_code_1000_ || code != 1000) {
27+
logging::debug(TAG,
28+
u8"反向 WebSocket 连接断开,close code: " + to_string(code) + ",reason:" + reason);
29+
notify_should_reconnect();
30+
}
31+
};
32+
client->on_error = [&](shared_ptr<typename WsClientT::Connection>, const SimpleWeb::error_code &e) {
33+
logging::debug(TAG, u8"反向 WebSocket 连接发生错误,error code: " + to_string(e.value()));
3034
notify_should_reconnect();
3135
};
3236
return client;
@@ -59,6 +63,7 @@ namespace cqhttp::plugins {
5963
client_.wss->start();
6064
}
6165
} catch (...) {
66+
logging::debug(TAG, u8"反向 WebSocket 建立连接失败");
6267
notify_should_reconnect();
6368
}
6469
started_ = false;

0 commit comments

Comments
 (0)