- Notifications
You must be signed in to change notification settings - Fork548
Commit85ec17a
authored
[Network] Improve bindings for NWProtocolMetadata. (#6389)
* [Network] Improve bindings for NWProtocolMetadata.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* Fix casing in exception message.* [tests] Adjust the SecProtocolMetadataTest according to new knowledge about the Network API.* Fix alternative property name in obsolete attribute.1 parent57d44d1 commit85ec17a
File tree
3 files changed
+123
-46
lines changed- src/Network
- tests/monotouch-test
- Network
- Security
3 files changed
+123
-46
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
90 | | - | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
91 | 119 | | |
92 | 120 | | |
93 | 121 | | |
| |||
96 | 124 | | |
97 | 125 | | |
98 | 126 | | |
99 | | - | |
100 | | - | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
101 | 135 | | |
102 | 136 | | |
103 | 137 | | |
104 | 138 | | |
105 | 139 | | |
106 | 140 | | |
107 | | - | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
108 | 145 | | |
109 | 146 | | |
110 | 147 | | |
| |||
113 | 150 | | |
114 | 151 | | |
115 | 152 | | |
| 153 | + | |
| 154 | + | |
116 | 155 | | |
117 | | - | |
118 | | - | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
119 | 170 | | |
120 | 171 | | |
121 | 172 | | |
122 | 173 | | |
123 | 174 | | |
124 | | - | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
125 | 180 | | |
126 | 181 | | |
127 | 182 | | |
128 | 183 | | |
129 | | - | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
130 | 189 | | |
131 | 190 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
| 32 | + | |
32 | 33 | | |
| 34 | + | |
33 | 35 | | |
34 | 36 | | |
35 | 37 | | |
36 | 38 | | |
37 | 39 | | |
38 | 40 | | |
39 | 41 | | |
40 | | - | |
41 | | - | |
| 42 | + | |
| 43 | + | |
42 | 44 | | |
43 | 45 | | |
44 | 46 | | |
45 | 47 | | |
46 | | - | |
47 | | - | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
48 | 52 | | |
49 | 53 | | |
50 | 54 | | |
51 | 55 | | |
52 | | - | |
| 56 | + | |
Lines changed: 46 additions & 32 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
4 | 7 | | |
5 | 8 | | |
6 | 9 | | |
| |||
21 | 24 | | |
22 | 25 | | |
23 | 26 | | |
24 | | - | |
| 27 | + | |
25 | 28 | | |
26 | | - | |
27 | | - | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
28 | 33 | | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
43 | 54 | | |
44 | | - | |
45 | | - | |
46 | | - | |
| 55 | + | |
| 56 | + | |
47 | 57 | | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
58 | 71 | | |
| 72 | + | |
| 73 | + | |
59 | 74 | | |
60 | 75 | | |
61 | | - | |
62 | 76 | | |
63 | 77 | | |
64 | | - | |
| 78 | + | |
0 commit comments
Comments
(0)