mirror of
https://codeberg.org/yeentown/barkey
synced 2024-11-25 05:55:14 +00:00
fix(backend): 無制限にストリーミングのチャンネルに接続できる問題を修正
This commit is contained in:
parent
6d3f9503ed
commit
76bbc10aa1
1 changed files with 6 additions and 0 deletions
|
@ -20,6 +20,8 @@ import type Channel from './channel.js';
|
||||||
import { LoggerService } from '@/core/LoggerService.js';
|
import { LoggerService } from '@/core/LoggerService.js';
|
||||||
import type Logger from '@/logger.js';
|
import type Logger from '@/logger.js';
|
||||||
|
|
||||||
|
const MAX_CHANNELS_PER_CONNECTION = 32;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Main stream connection
|
* Main stream connection
|
||||||
*/
|
*/
|
||||||
|
@ -283,6 +285,10 @@ export default class Connection {
|
||||||
*/
|
*/
|
||||||
@bindThis
|
@bindThis
|
||||||
public connectChannel(id: string, params: any, channel: string, pong = false) {
|
public connectChannel(id: string, params: any, 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) {
|
||||||
|
|
Loading…
Reference in a new issue