Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Network] Improve bindings for NWProtocolMetadata.#6389

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

@rolfbjarne
Copy link
Member

It turns out the NWProtocolMetadata can contain metadata for different
protocols (Ip/Tls/Tcp). This is important; if someone tries to get a value for
one protocol and the metadata is for another protocol, then they invoke the
wrath of superior beings who will smite that poor someone with uninitialized
memory.

At that point there's not much left but to pray.

I don't like to depend on divine intervention, so I've modified the API here
to check if the metadata's protocol is the required type for the native API
we're calling, and if the check fails, we throw a nice and dependable managed
exception.

This is a functional breaking change; but if there are any lost souls who
likes to pray, they can always re-implement the P/Invokes themselves and skip
the sanity checks.

In addition I've renamed a few properties whose name didn't clearly specify
which protocol type they operate on.

Ref: Apple feedback FB6155967.
Ref:https://trello.com/c/1TW0BSKJ/145-fb6155967-nwipcreatemetadata-returns-uninitialized-metadata-in-ios-13

It turns out the NWProtocolMetadata can contain metadata for differentprotocols (Ip/Tls/Tcp). This is important; if someone tries to get a value forone protocol and the metadata is for another protocol, then they invoke thewrath of superior beings who will smite that poor someone with uninitializedmemory.At that point there's not much left but to pray.I don't like to depend on divine intervention, so I've modified the API hereto check if the metadata's protocol is the required type for the native APIwe're calling, and if the check fails, we throw a nice and dependable managedexception.This is a functional breaking change; but if there are any lost souls wholikes to pray, they can always re-implement the P/Invokes themselves and skipthe sanity checks.In addition I've renamed a few properties whose name didn't clearly specifywhich protocol type they operate on.Ref: Apple feedback FB6155967.Ref:https://trello.com/c/1TW0BSKJ/145-fb6155967-nwipcreatemetadata-returns-uninitialized-metadata-in-ios-13
Copy link
Contributor

@spouliotspouliot left a comment

Choose a reason for hiding this comment

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

minor

voidCheckIsTcp()
{
if(!IsTcp)
thrownewInvalidOperationException("This metadata is not Tcp metadata.");
Copy link
Contributor

Choose a reason for hiding this comment

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

TCP in the text itself

@spouliotspouliot added this to thexcode11 milestoneJun 20, 2019
@monojenkins
Copy link
Collaborator

Build failure
Build succeeded
API Diff (from stable)
ℹ️API Diff (from PR only) (please review changes)
Generator Diff (no change)
🔥Test run failed 🔥

Test results

4 tests failed, 87 tests passed.

Failed tests

  • xammac tests/Mac Modern/Debug: Failed (Test run failed.)
  • xammac tests/Mac Modern/Release: Failed (Test run failed.)
  • xammac tests/Mac Modern/Release: Failed (Test run failed.)
  • MSBuild tests/iOS: Failed (Execution failed with exit code 1)

@monojenkins
Copy link
Collaborator

Build failure
Build succeeded
API Diff (from stable)
ℹ️API Diff (from PR only) (please review changes)
Generator Diff (no change)
🔥Test run failed 🔥

Test results

16 tests failed, 75 tests passed.

Failed tests

  • monotouch-test/watchOS 32-bits - simulator/Debug: TimedOut
  • framework-test/watchOS 32-bits - simulator/Debug: TimedOut
  • mini/watchOS 32-bits - simulator/Debug: TimedOut
  • interdependent-binding-projects/watchOS 32-bits - simulator/Debug: Crashed
  • fsharp/watchOS 32-bits - simulator/Debug: Crashed
  • introspection/watchOS 32-bits - simulator/Debug: Crashed
  • dont link/watchOS 32-bits - simulator/Debug: Crashed
  • dont link/watchOS 32-bits - simulator/Release: Crashed
  • link all/watchOS 32-bits - simulator/Debug: Crashed
  • link all/watchOS 32-bits - simulator/Release: Crashed
  • link sdk/watchOS 32-bits - simulator/Debug: Crashed
  • link sdk/watchOS 32-bits - simulator/Release: Crashed
  • mono-native-compat/watchOS 32-bits - simulator/Debug: Crashed
  • mono-native-unified/watchOS 32-bits - simulator/Debug: Crashed
  • monotouch-test/watchOS 32-bits - simulator/Debug (static registrar): Crashed
  • monotouch-test/watchOS 32-bits - simulator/Release (all optimizations): Crashed

@rolfbjarne
Copy link
MemberAuthor

Test failures are unrelated

@rolfbjarnerolfbjarne merged commit85ec17a intodotnet:xcode11Jun 21, 2019
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@dalexsotodalexsotodalexsoto approved these changes

@migueldeicazamigueldeicazaAwaiting requested review from migueldeicaza

+2 more reviewers

@spouliotspouliotspouliot approved these changes

@mandel-macaquemandel-macaquemandel-macaque approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

xcode11

Development

Successfully merging this pull request may close these issues.

5 participants

@rolfbjarne@monojenkins@dalexsoto@spouliot@mandel-macaque

[8]ページ先頭

©2009-2025 Movatter.jp