Skip to content

Commit

Permalink
Merge pull request #412 from na-trium-144/fix_client_id
Browse files Browse the repository at this point in the history
無名のクライアントが複数いるときのclient_idの振り分けバグを修正
  • Loading branch information
na-trium-144 authored Oct 7, 2024
2 parents 8a7ce99 + 76e40e7 commit 28f59aa
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 31 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## [2.4.1] - 2024-10-07
### Fixed
* 無名のクライアントが複数いるときclient_idの振り分けが間違っておりcall_responseが正しく返らないバグを修正 (#412)

## [2.4.0] - 2024-10-02
### Changed
* Logメッセージを仕様変更、Logに名前をつけて複数送信できるようになった (#410)
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.5)

project(webcface VERSION 2.4.0)
project(webcface VERSION 2.4.1)

if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
set(IS_MAIN on)
Expand Down
2 changes: 1 addition & 1 deletion Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ PROJECT_NAME = "WebCFace"
# could be handy for archiving the generated documentation or if some version
# control system is used.

PROJECT_NUMBER = "2.4.0"
PROJECT_NUMBER = "2.4.1"

# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
Expand Down
48 changes: 24 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,9 @@ Ubuntu20.04でビルドしているため、それより古いUbuntuでは動作
<details open><summary>x86_64</summary>

```sh
curl -fLO https://github.com/na-trium-144/webcface-package/releases/download/v2.4.0-1/webcface_2.4.0-1_linux_amd64.zip
sudo unzip webcface_2.4.0-1_linux_amd64.zip -d /opt/webcface
rm webcface_2.4.0-1_linux_amd64.zip
curl -fLO https://github.com/na-trium-144/webcface-package/releases/download/v2.4.1/webcface_2.4.1_linux_amd64.zip
sudo unzip webcface_2.4.1_linux_amd64.zip -d /opt/webcface
rm webcface_2.4.1_linux_amd64.zip
echo 'export PATH="/opt/webcface/bin:$PATH"' >> ~/.bashrc
echo 'export PKG_CONFIG_PATH="/opt/webcface/lib/x86_64-linux-gnu/pkgconfig:$PKG_CONFIG_PATH"' >> ~/.bashrc
sudo ln -sf /opt/webcface/lib/systemd/system/*.service /etc/systemd/system/
Expand All @@ -207,9 +207,9 @@ sudo ln -sf /opt/webcface/lib/systemd/system/*.service /etc/systemd/system/
<details><summary>arm64</summary>

```sh
curl -fLO https://github.com/na-trium-144/webcface-package/releases/download/v2.4.0-1/webcface_2.4.0-1_linux_arm64.zip
sudo unzip webcface_2.4.0-1_linux_arm64.zip -d /opt/webcface
rm webcface_2.4.0-1_linux_arm64.zip
curl -fLO https://github.com/na-trium-144/webcface-package/releases/download/v2.4.1/webcface_2.4.1_linux_arm64.zip
sudo unzip webcface_2.4.1_linux_arm64.zip -d /opt/webcface
rm webcface_2.4.1_linux_arm64.zip
echo 'export PATH="/opt/webcface/bin:$PATH"' >> ~/.bashrc
echo 'export PKG_CONFIG_PATH="/opt/webcface/lib/aarch64-linux-gnu/pkgconfig:$PKG_CONFIG_PATH"' >> ~/.bashrc
sudo ln -sf /opt/webcface/lib/systemd/system/*.service /etc/systemd/system/
Expand All @@ -219,9 +219,9 @@ sudo ln -sf /opt/webcface/lib/systemd/system/*.service /etc/systemd/system/
<details><summary>armhf</summary>

```sh
curl -fLO https://github.com/na-trium-144/webcface-package/releases/download/v2.4.0-1/webcface_2.4.0-1_linux_armhf.zip
sudo unzip webcface_2.4.0-1_linux_armhf.zip -d /opt/webcface
rm webcface_2.4.0-1_linux_armhf.zip
curl -fLO https://github.com/na-trium-144/webcface-package/releases/download/v2.4.1/webcface_2.4.1_linux_armhf.zip
sudo unzip webcface_2.4.1_linux_armhf.zip -d /opt/webcface
rm webcface_2.4.1_linux_armhf.zip
echo 'export PATH="/opt/webcface/bin:$PATH"' >> ~/.bashrc
echo 'export PKG_CONFIG_PATH="/opt/webcface/lib/arm-linux-gnueabihf/pkgconfig:$PKG_CONFIG_PATH"' >> ~/.bashrc
sudo ln -sf /opt/webcface/lib/systemd/system/*.service /etc/systemd/system/
Expand All @@ -242,10 +242,10 @@ Ubuntu20.04でビルドしているため、それより古いUbuntuでは動作
<details open><summary>x86_64</summary>

```sh
curl -fLO https://github.com/na-trium-144/webcface/releases/download/v2.4.0/webcface_2.4.0_amd64.deb
curl -fLO https://github.com/na-trium-144/webcface/releases/download/v2.4.1/webcface_2.4.1_amd64.deb
curl -fLO https://github.com/na-trium-144/webcface-tools/releases/download/v2.1.0/webcface-tools_2.1.0_amd64.deb
curl -fLO https://github.com/na-trium-144/webcface-webui/releases/download/v1.9.0/webcface-webui_1.9.0_all.deb
curl -fLO https://github.com/na-trium-144/webcface-webui/releases/download/v1.9.0/webcface-desktop_1.9.0_linux_amd64.deb
curl -fLO https://github.com/na-trium-144/webcface-webui/releases/download/v1.9.1/webcface-webui_1.9.1_all.deb
curl -fLO https://github.com/na-trium-144/webcface-webui/releases/download/v1.9.1/webcface-desktop_1.9.1_linux_amd64.deb
sudo apt install ./webcface*.deb
rm ./webcface*.deb
```
Expand All @@ -254,10 +254,10 @@ rm ./webcface*.deb
<details><summary>arm64</summary>

```sh
curl -fLO https://github.com/na-trium-144/webcface/releases/download/v2.4.0/webcface_2.4.0_arm64.deb
curl -fLO https://github.com/na-trium-144/webcface/releases/download/v2.4.1/webcface_2.4.1_arm64.deb
curl -fLO https://github.com/na-trium-144/webcface-tools/releases/download/v2.1.0/webcface-tools_2.1.0_arm64.deb
curl -fLO https://github.com/na-trium-144/webcface-webui/releases/download/v1.9.0/webcface-webui_1.9.0_all.deb
curl -fLO https://github.com/na-trium-144/webcface-webui/releases/download/v1.9.0/webcface-desktop_1.9.0_linux_arm64.deb
curl -fLO https://github.com/na-trium-144/webcface-webui/releases/download/v1.9.1/webcface-webui_1.9.1_all.deb
curl -fLO https://github.com/na-trium-144/webcface-webui/releases/download/v1.9.1/webcface-desktop_1.9.1_linux_arm64.deb
sudo apt install ./webcface*.deb
rm ./webcface*.deb
```
Expand All @@ -266,10 +266,10 @@ rm ./webcface*.deb
<details><summary>armhf</summary>

```sh
curl -fLO https://github.com/na-trium-144/webcface/releases/download/v2.4.0/webcface_2.4.0_armhf.deb
curl -fLO https://github.com/na-trium-144/webcface/releases/download/v2.4.1/webcface_2.4.1_armhf.deb
curl -fLO https://github.com/na-trium-144/webcface-tools/releases/download/v2.1.0/webcface-tools_2.1.0_armhf.deb
curl -fLO https://github.com/na-trium-144/webcface-webui/releases/download/v1.9.0/webcface-webui_1.9.0_all.deb
curl -fLO https://github.com/na-trium-144/webcface-webui/releases/download/v1.9.0/webcface-desktop_1.9.0_linux_armv7l.deb
curl -fLO https://github.com/na-trium-144/webcface-webui/releases/download/v1.9.1/webcface-webui_1.9.1_all.deb
curl -fLO https://github.com/na-trium-144/webcface-webui/releases/download/v1.9.1/webcface-desktop_1.9.1_linux_armv7l.deb
sudo apt install ./webcface*.deb
rm ./webcface*.deb
```
Expand All @@ -288,16 +288,16 @@ Universalバイナリになっており、IntelMacもAppleシリコンも共通
macOS 12 (Monterey) でビルドしているので、それより古いMacでは動かないかもしれません。

```sh
curl -fLO https://github.com/na-trium-144/webcface-package/releases/download/v2.4.0-1/webcface_2.4.0-1_macos_universal.zip
curl -fLO https://github.com/na-trium-144/webcface-package/releases/download/v2.4.0-1/webcface-desktop_2.4.0-1_macos_app.zip
curl -fLO https://github.com/na-trium-144/webcface-package/releases/download/v2.4.1/webcface_2.4.1_macos_universal.zip
curl -fLO https://github.com/na-trium-144/webcface-package/releases/download/v2.4.1/webcface-desktop_2.4.1_macos_app.zip
```

sudo権限が使用できれば以下のように webcface_universal を /opt/webcface に、 webcface-desktop_app を /Applications に展開するのがおすすめです。
```sh
sudo unzip webcface_2.4.0-1_macos_universal.zip -d /opt/webcface
sudo unzip webcface-desktop_2.4.0-1_macos_app.zip -d /Applications
rm webcface_2.4.0-1_macos_universal.zip
rm webcface-desktop_2.4.0-1_macos_app.zip
sudo unzip webcface_2.4.1_macos_universal.zip -d /opt/webcface
sudo unzip webcface-desktop_2.4.1_macos_app.zip -d /Applications
rm webcface_2.4.1_macos_universal.zip
rm webcface-desktop_2.4.1_macos_app.zip
```

また、展開したディレクトリ内の bin/ をPATHに、 lib/pkgconfig/ をPKG_CONFIG_PATHに追加してください。
Expand Down
4 changes: 2 additions & 2 deletions docs/31_setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ MesonまたはCMakeを使用する場合は、subproject/subdirectoryとしてWe
```
[wrap-git]
url = https://github.com/na-trium-144/webcface.git
revision = v2.4.0
revision = v2.4.1
depth = 1
[provide]
dependency_names = webcface
Expand Down Expand Up @@ -66,7 +66,7 @@ MesonまたはCMakeを使用する場合は、subproject/subdirectoryとしてWe
```cmake
FetchContent_Declare(webcface
GIT_REPOSITORY https://github.com/na-trium-144/webcface.git
GIT_TAG v2.4.0
GIT_TAG v2.4.1
)
FetchContent_MakeAvailable(webcface)
```
Expand Down
4 changes: 2 additions & 2 deletions meson.build
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
project('webcface', 'c', 'cpp',
version: '2.4.0',
version: '2.4.1',
license: 'MIT',
meson_version: '>=1.3.0',
default_options: [
Expand All @@ -18,7 +18,7 @@ py = find_program('python3')

webcface_abi_major = '20' # ABIの破壊的変更で1増やす
webcface_abi_minor = '3' # ABIの追加で1増やす
webcface_webui_version = '1.9.0'
webcface_webui_version = '1.9.1'

webcface_description = 'Web-based IPC & Dashboard-like UI'
webcface_contact = 'na-trium-144@users.noreply.github.com'
Expand Down
3 changes: 2 additions & 1 deletion server-store/src/member_data.cc
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,8 @@ void MemberData::onRecv(const std::string &message) {
auto prev_cli_it = std::find_if(
clients_by_id.begin(), clients_by_id.end(),
[&](const auto &it) { return it.second->name == this->name; });
if (prev_cli_it != clients_by_id.end()) {
if (prev_cli_it != clients_by_id.end() && !this->name.empty()) {
// すでに同じ名前のクライアントがいたら & 名前が空でなければ そのidを使う
this->member_id = v.member_id = prev_cli_it->first;
} else {
// コンストラクタですでに一意のidが振られているはず
Expand Down

0 comments on commit 28f59aa

Please sign in to comment.