Skip to content
New issue

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

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

Already on GitHub? # to your account

Refactor duplicated logic in http/ipc servers. #6

Closed
njgheorghita opened this issue Mar 14, 2021 · 0 comments · Fixed by #9
Closed

Refactor duplicated logic in http/ipc servers. #6

njgheorghita opened this issue Mar 14, 2021 · 0 comments · Fixed by #9

Comments

@njgheorghita
Copy link
Collaborator

njgheorghita commented Mar 14, 2021

https://github.com/carver/trin/pull/2/files#r590773236

Oof, there's a lot of duplicated logic in here between the two servers. Not sure the best way to DRY off-hand. Maybe make a function that takes in the json iterator and returns an iterator over the result values.

Also improve input data validation

I know the error handling was already this way in the IPC code, but it's bad news. Sending bad input data to trin should reply with an error, instead of crashing trin.

https://github.com/carver/trin/pull/2/files#diff-b2812f19576dd53d0c35b107a322f58a00fce6977f4b5976e1961853982af3ccR199-R203

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant