Commit d2dd7e9
committed
networking: Initialize NetworkingModule with proper OkHttpClient.
`getOkHttpClient` calls `createClient` if `OkHttpClientProvider` has
no sClient (the root client) yet. Otherwise, it returns the root client.
Thus, it has basically the same effect as `createClient` in this case,
since only one NetworkingModule is ever instantiated and sharing its
client with the very few other instances where OkHttpClientProvider is
used shouldn't be a problem.
We need this change so that OkHttpClientProvider gets an initialized
sClient (`createClient` doesn't initialize the sClient, it just returns
a new client). This will be necessary in the next commit, which fixes
a networking bug.1 parent 370bcff commit d2dd7e9
File tree
1 file changed
+3
-4
lines changed- ReactAndroid/src/main/java/com/facebook/react/modules/network
1 file changed
+3
-4
lines changedLines changed: 3 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
161 | 161 | | |
162 | 162 | | |
163 | 163 | | |
164 | | - | |
| 164 | + | |
165 | 165 | | |
166 | 166 | | |
167 | 167 | | |
| |||
172 | 172 | | |
173 | 173 | | |
174 | 174 | | |
175 | | - | |
| 175 | + | |
176 | 176 | | |
177 | 177 | | |
178 | 178 | | |
| |||
181 | 181 | | |
182 | 182 | | |
183 | 183 | | |
184 | | - | |
| 184 | + | |
185 | 185 | | |
186 | 186 | | |
187 | 187 | | |
| |||
277 | 277 | | |
278 | 278 | | |
279 | 279 | | |
280 | | - | |
281 | 280 | | |
282 | 281 | | |
283 | 282 | | |
| |||
0 commit comments