Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Config: Failed to parse config ending with newline. #2228

Open
Nibbler999 opened this issue Mar 6, 2021 · 3 comments · May be fixed by #4042
Open

Config: Failed to parse config ending with newline. #2228

Nibbler999 opened this issue Mar 6, 2021 · 3 comments · May be fixed by #4042
Assignees
Labels
Bug It might be a bug. TransByAI Translated by AI/GPT.
Milestone

Comments

@Nibbler999
Copy link

Nibbler999 commented Mar 6, 2021

Description'

Please ensure that the markdown structure is maintained.

Documentation for realtime config has an error

  1. SRS version: 3.0.153
  2. The log of SRS is as follows:'

Please ensure that the markdown structure is maintained.

start play smi=0ms, mw_sleep=100, mw_enabled=1, realtime=0, tcp_nodelay=1
  1. The configuration of SRS is as follows:

Please ensure that the markdown structure is maintained.

# the listen ports, split by space.
listen              1935;
vhost __defaultVhost__ {
    tcp_nodelay     on
    min_latency     on;

    play {
        gop_cache       off;
        queue_length    10;
        mw_latency      100;
    }

    publish {
        mr off;
    }
}

Replay

Please ensure that the markdown structure is maintained.

Play stream with rtmp client and check log

Expect

Please ensure that the markdown structure is maintained.

realtime=1

If I add the missing semi-colon to the config after tcp_nodelay on then the min_latency setting is applied correctly. The sample configuration is incorrect in both conf/realtime.conf and the wiki in both languages.

TRANS_BY_GPT3

@winlinvip winlinvip added the Bug It might be a bug. label Jun 16, 2021
@winlinvip winlinvip added this to the SRS 3.0 release milestone Jun 16, 2021
@winlinvip
Copy link
Member

It seems a bug.

@winlinvip winlinvip self-assigned this Aug 21, 2021
@winlinvip
Copy link
Member

winlinvip commented Dec 26, 2021

It's bug for config to parsing the config directive, should be error when ends with '\n' without ';'

Postpone to 5.0

@winlinvip winlinvip self-assigned this Dec 26, 2021
@winlinvip winlinvip modified the milestones: 4.0, 5.0 Dec 26, 2021
@winlinvip winlinvip added the TransByAI Translated by AI/GPT. label Jul 29, 2023
@winlinvip winlinvip changed the title Documentation for realtime config has an error Config: Failed to parse config ending with newline. Apr 23, 2024
@winlinvip
Copy link
Member

winlinvip commented Apr 23, 2024

Each config directive should end with ; or semi-colon. We should not only fix this bug, but also cover by utest. This means bellow testcase should fail, as tcp_nodelay on is missing a semicolon:

    tcp_nodelay     on
    min_latency     on;

suzp1984 added a commit to suzp1984/srs that referenced this issue Apr 24, 2024
make sure one directive token don't span more than two lines.
@suzp1984 suzp1984 linked a pull request Apr 24, 2024 that will close this issue
suzp1984 added a commit to suzp1984/srs that referenced this issue Apr 24, 2024
make sure one directive token don't span more than two lines.
suzp1984 added a commit to suzp1984/srs that referenced this issue Apr 24, 2024
make sure one directive token don't span more than two lines.
suzp1984 added a commit to suzp1984/srs that referenced this issue Apr 24, 2024
make sure one directive token don't span more than two lines.
suzp1984 added a commit to suzp1984/srs that referenced this issue Apr 24, 2024
make sure one directive token don't span more than two lines.
suzp1984 added a commit to suzp1984/srs that referenced this issue Apr 24, 2024
make sure one directive token don't span more than two lines.
suzp1984 added a commit to suzp1984/srs that referenced this issue Apr 24, 2024
make sure one directive token don't span more than two lines.
suzp1984 added a commit to suzp1984/srs that referenced this issue Apr 24, 2024
make sure one directive token don't span more than two lines.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug It might be a bug. TransByAI Translated by AI/GPT.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants