fix(backend): 無制限にストリーミングのチャンネルに接続できる問題を修正
This commit is contained in:
		| @@ -24,6 +24,7 @@ | |||||||
| - Fix: ActivityPubのエンティティタイプ判定で不明なタイプを受け取った場合でも処理を継続するように | - Fix: ActivityPubのエンティティタイプ判定で不明なタイプを受け取った場合でも処理を継続するように | ||||||
|   - キュー処理のつまりが改善される可能性があります |   - キュー処理のつまりが改善される可能性があります | ||||||
| - Fix: リバーシの対局設定の変更が反映されないのを修正 | - Fix: リバーシの対局設定の変更が反映されないのを修正 | ||||||
|  | - Fix: 無制限にストリーミングのチャンネルに接続できる問題を修正 | ||||||
|  |  | ||||||
| ## 2024.7.0 | ## 2024.7.0 | ||||||
|  |  | ||||||
|   | |||||||
| @@ -20,6 +20,8 @@ import type { ChannelsService } from './ChannelsService.js'; | |||||||
| import type { EventEmitter } from 'events'; | import type { EventEmitter } from 'events'; | ||||||
| import type Channel from './channel.js'; | import type Channel from './channel.js'; | ||||||
|  |  | ||||||
|  | const MAX_CHANNELS_PER_CONNECTION = 32; | ||||||
|  |  | ||||||
| /** | /** | ||||||
|  * Main stream connection |  * Main stream connection | ||||||
|  */ |  */ | ||||||
| @@ -255,6 +257,10 @@ export default class Connection { | |||||||
| 	 */ | 	 */ | ||||||
| 	@bindThis | 	@bindThis | ||||||
| 	public connectChannel(id: string, params: JsonObject | undefined, channel: string, pong = false) { | 	public connectChannel(id: string, params: JsonObject | undefined, channel: string, pong = false) { | ||||||
|  | 		if (this.channels.length >= MAX_CHANNELS_PER_CONNECTION) { | ||||||
|  | 			return; | ||||||
|  | 		} | ||||||
|  |  | ||||||
| 		const channelService = this.channelsService.getChannelService(channel); | 		const channelService = this.channelsService.getChannelService(channel); | ||||||
|  |  | ||||||
| 		if (channelService.requireCredential && this.user == null) { | 		if (channelService.requireCredential && this.user == null) { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 syuilo
					syuilo