-
-
Notifications
You must be signed in to change notification settings - Fork 56
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
Refactor getBestPublicIp for all valid ips #1132
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1132 +/- ##
==========================================
- Coverage 41.43% 41.42% -0.02%
==========================================
Files 59 59
Lines 4245 4268 +23
Branches 2323 2336 +13
==========================================
+ Hits 1759 1768 +9
- Misses 990 999 +9
- Partials 1496 1501 +5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@sgourdas thx for the PR but can you please fix the code so the CI can pass? |
@kelson42 ready |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost good, but
$ kiwix-serve --port=8080 -i 127.0.0.1 /home/kelson/Downloads/wikipedia_en_ray_charles_maxi_2023-12.zim
The Kiwix server is running and can be accessed in the local network at: http://192.168.0.168:8080 and http://::1:808
Should return only http://127.0.0.1:8080
as kiwix-serve should only listen on this IP
5276f1c
to
b2a7704
Compare
Still not working fine:
@sgourdas Please test all of this completly. |
@kelson42 I tested this and it was working fine for me. Tested again and I get:
|
Have you built both new kiwix tools and libkiwix versions? If yes, can you provide more details like if despite the printed message the server is available in browser? |
@sgourdas This will wait tomorrow, I kind of suspect something wrong in my testing because of the renaming of the |
b2a7704
to
eb3e76a
Compare
6803fa4
to
1a09276
Compare
@sgourdas Still wrong! You are "cheating" (taking for IPV4 the localhost instead of the public IP)!
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I started reviewing while the PR was being updated. My feeling is that my feedback doesn't pave the path to this PR being merged on next iteration, it seems like we will have to make at least a couple more back-and-forths.
Sorry for this. This PR is not up to standard and I have to revise all the changes. When it started, I expected it to be more straight forward and it has become very unstructured. Will try to get back ASAP. |
d87643d
to
97ad823
Compare
2e89cd3
to
2fe632a
Compare
2fe632a
to
a15415e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LLIONSPBP
If you wonder what that abbreviation stands for and cannot guess it yourself, than turn for help to an Asian constricting snake and ask it to evaluate the expression 'gnihsilbup erofeb gnihsilop emos sdeen ylno ti ekil skooL'[::-1]
.
d71a005
to
6fadb63
Compare
TICIFA If you want to continue, but do not know what I am saying, you can use this: {
0x21, 0x64, 0x65, 0x74, 0x63, 0x69, 0x64, 0x64,
0x41, 0x20, 0x6C, 0x65, 0x65, 0x46, 0x20, 0x49,
0x20, 0x2C, 0x6E, 0x61, 0x65, 0x6C, 0x43, 0x20,
0x73, 0x49, 0x20, 0x73, 0x69, 0x68, 0x54
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no limit on how clean code can be. Since you gave me an excuse I will ask for more cleanliness. 😉
6fadb63
to
ec22d26
Compare
I will now stop talking, after saying that it looks very nice! |
ec22d26
to
95529d2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sgourdas Thanks for bearing with the perfectionist side of me! The result of it is that this code can now be safely run in a surgery room.
@kelson42 Despite my above assessment of the quality of the code of this PR, I am reminding that cleanliness is orthogonal to functionality. A hammer can be super-clean and perfectly disinfected however it is not suitable for performing colonoscopy. Though I paid attention to the semantics of the code during the final review I didn't test it and hence don't have 100% confidence against the infamous treacherousness of C++. Please repeat your testing before merging.
@veloman-yunkan Thx but unable to test, the kiwix-tools PR does not compile! |
@kelson42 it should be good now. |
LGTM |
This refactors
getBestPublicIp(bool)
togetBestPublicIps(IpMode)
so it can correctly return all attached ips for both protocols ipv4 and ipv6.Fixes kiwix/kiwix-tools#703
Fixes kiwix/kiwix-tools#709