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

Use index variable when access to the upstreamConnectionDelays array #150

Merged
merged 6 commits into from
May 18, 2023

Conversation

byeonggiljun
Copy link
Collaborator

@byeonggiljun byeonggiljun commented Apr 19, 2023

Until now, depensOnFedId has been used for accessing the upstreamConnectionDelays.

for (let candidate of config.upstreamConnectionDelays[dependsOnFedId]) {

However, this can cause an array index out of bound exception.

Thus, in this PR, we use an index variable to access both dependsOn and upstreamConnectionDelays arrays. Also, we add an exception check to ensure that the length of those two arrays is identical.

@byeonggiljun byeonggiljun requested review from hokeun and lhstrh April 19, 2023 01:21
src/core/federation.ts Outdated Show resolved Hide resolved
@byeonggiljun byeonggiljun requested a review from hokeun May 16, 2023 11:36
Copy link
Member

@hokeun hokeun left a comment

Choose a reason for hiding this comment

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

I updated the code myself to help - please check if it makes sense.
Also, please update the description of this PR to match what this PR actually does before merging this PR.

@byeonggiljun byeonggiljun merged commit 45e96ab into master May 18, 2023
@byeonggiljun byeonggiljun deleted the up-conn-delays-index branch May 20, 2023 07:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants