-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Rename "announced ip" to "announced address" #1324
Conversation
Fixes #1323 - Rust: In `TransportListenInfo` rename `announced_ip` to `announced_address`. - Rust: In `IceCandidate` rename `ip` to `address`. - Rust: In `TransportTuple` rename `local_ip` to `local_address`. - Node: In `TransportListenInfo` rename `announcedIp` to `announcedAddress` and keep backwards compatibility. - Node: In `IceCandidate` rename `ip` to `address` and keep backwards compatibility. - Node: In `TransportTuple` rename `localIp` to `localAddress` and keep backwards compatibility. **NOTE:** Why has been `TransportTuple.localIp` renamed to `TransportTuple.localAddress`? Because indeed its value is an announced address if a hostname was given in `announcedAddress` in a `TransportListenInfo`.
TODO: Once merged/released, docs in website must be updated. |
Missing thing, |
I need help to resolve this:
In the first error I've tried
This mutex/lock thing is above my (increasing) little knowledge, so @nazar-pc help plz. |
I think you want to clone inner data, in which case it should be |
I tried it already but...
|
let number = 5;
let number_copy = *&number; Since the type you have is no longer So what was So essentially you'll do this: let s = "Hello".to_string();
let s_copy = (&s).clone(); |
So indeed replacing |
In addition I've also fixed another issue as follows:
Solution in line 689: *data.tuple.lock() = tuple.clone(); Hope it's ok. IMHO it is since it follows same rationale as discussed in above comments. |
|
Ok this is ready for review. @nazar-pc please. |
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 may not be looking carefully, but looks like TypeScript doesn't process announcedIp
correctly now. It seems to send it to worker, but worker only cares about announcedAddress
now. You should add something like announcedAddress = announcedAddress || announcedIp
on TypeScript side and not send announcedIp
to worker anymore.
rust/src/data_structures.rs
Outdated
announced_address: self | ||
.announced_address | ||
.clone() | ||
.map(|address| address.to_string()), |
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.
Two allocations look strange. I'm pretty sure this will also work:
announced_address: self | |
.announced_address | |
.clone() | |
.map(|address| address.to_string()), | |
announced_address: self | |
.announced_address | |
.as_ref() | |
.map(|address| address.to_string()), |
Though this is not new, it was like this before, I just comment on what I noticed.
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.
You mean that this thing should also be done in other changes I did?
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.
Maybe, but I was commenting just about this one
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.
On it.
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.
Nope, I don't see any other place in which as_ref()
can be used instead of cloning.
Moving back to draft PR because I forgot lot of things. |
@nazar-pc, I should also update Changelog and versions in Rust, right? |
Yes, please |
Rust versions bump done. |
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.
Makes sense to me
Fixes #1323
TransportListenInfo
renameannounced_ip
toannounced_address
.IceCandidate
renameip
toaddress
.TransportTuple
renamelocal_ip
tolocal_address
.TransportListenInfo
renameannouncedIp
toannouncedAddress
and keep backwards compatibility.IceCandidate
renameip
toaddress
and keep backwards compatibility.TransportTuple
renamelocalIp
tolocalAddress
and keep backwards compatibility.NOTE: Why has been
TransportTuple.localIp
renamed toTransportTuple.localAddress
? Because indeed its value is an announced address if a hostname was given inannouncedAddress
in aTransportListenInfo
.