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

[docs] Added Rejection Reasons document #2762

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

maxsharabayko
Copy link
Collaborator

Fixes #2742.

@maxsharabayko maxsharabayko added Type: Enhancement Indicates new feature requests [docs] Area: Improvements or additions to documentation labels Jul 13, 2023
@maxsharabayko maxsharabayko added this to the v1.6.0 milestone Jul 13, 2023

## Summary of Rejection Codes

Rejection codes are used in the SRT API, and are transferred on the wire as a part of a Handshake packet (refer to the `Handshake Type` field of the Handshake packet).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Rejection codes are used in the SRT API, and are transferred on the wire as a part of a Handshake packet (refer to the `Handshake Type` field of the Handshake packet).
Rejection codes are used in the SRT API, and are transferred on the wire as a part of a Handshake packet (refer to the `Handshake Type` field of the [Handshake](./docs/features/handshake.md) packet).


- `SRT_REJ`: standard rejection codes from SRT API functions (0 - 99)
- `SRT_REJC`: mark the border values between ranges.
- `SRT_REJX`: extended rejection codes (400 – 599) :warning: *@max is this the correct range (see comments above)?*
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See inline comment.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be simply "code values above 1000", if you speak about the SRT_REJX prefix.

making sure that the applications at either end of a connection understand them.

The intention here is for the predefined codes to be consistent with the HTTP
standard codes. Such code can be set by using the `srt_setrejectreason` function.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
standard codes. Such code can be set by using the `srt_setrejectreason` function.
standard codes. Such code can be set by using the [`srt_setrejectreason`](docs/api/api-functions.md#srt-setrejectreason) function.

@@ -0,0 +1,470 @@
# SRT Rejection Codes

This document provides an overview of the rejection (error) codes used by and supported within SRT and SRT-based applications.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This document provides an overview of the rejection (error) codes used by and supported within SRT and SRT-based applications.
This document provides an overview of the rejection (error) codes used by and supported within SRT and SRT-based applications. For information on other types of error codes refer to the [API Socket Options](./docs/API/API-socket-options.md) document.

Copy link
Collaborator

@stevomatthews stevomatthews left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added some links, plus minor edits


### SRT Internal Rejection Codes

Defined in [**srt.h**](srtcore/srt.h), these codes provide the reason why a connection is rejected by SRT. They cover the reserved range 0 - 999 (below `SRT_REJC_PREDEFINED`).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Defined in [**srt.h**](srtcore/srt.h), these codes provide the reason why a connection is rejected by SRT. They cover the reserved range 0 - 999 (below `SRT_REJC_PREDEFINED`).
Defined in [**srt.h**](srtcore/srt.h), these codes provide the reason why a connection is rejected by SRT. They cover the reserved range 0 - 999 (below `SRT_REJC_PREDEFINED`). These codes cannot be used by applications to report a rejection reason.

- `SRT_REJ_SYSTEM` = 1
- ...
- `SRT_REJ_CRYPTO` = 17

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
See [the list below](#api-function-rejection-codes) for details.

- `SRT_REJX`: extended rejection codes (400 – 599) :warning: *@max is this the correct range (see comments above)?*


## API Function Rejection Reasons
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wasn't exactly the same already collected in a table above?

#### SRT_REJ_CLOSE

The listener socket was able to receive the request, but is currently
being closed. It's likely that the next request will result in a timeout.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

leading space

| 1403 | [SRT_REJX_FORBIDDEN](#SRT_REJX_FORBIDDEN) | 1.4.2 | Access denied to the resource for any reason. |
| 1404 | [SRT_REJX_NOTFOUND](#SRT_REJX_NOTFOUND) | 1.4.2 | Resource specified by `r` and `h` keys cannot be found. |
| 1405 | [SRT_REJX_BAD_MODE](#SRT_REJX_BAD_MODE) | 1.4.2 | Mode specified in the `m` key in StreamID is not supported for this request. |
| 1406 | [SRT_REJX_UNACCEPTABLE](#SRT_REJX_UNACCEPTABLE) | 1.4.2 | Unavailable parameters in `SocketID`, or `m=publish` data format not supported. |
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| 1406 | [SRT_REJX_UNACCEPTABLE](#SRT_REJX_UNACCEPTABLE) | 1.4.2 | Unavailable parameters in `SocketID`, or `m=publish` data format not supported. |
| 1406 | [SRT_REJX_UNACCEPTABLE](#SRT_REJX_UNACCEPTABLE) | 1.4.2 | Unavailable parameters in `StreamID`, or `m=publish` data format not supported. |

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[docs] Area: Improvements or additions to documentation Type: Enhancement Indicates new feature requests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dedicated document for Rejection Reason Codes
3 participants