You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Executing code like this when netfox is active causes several bad things to happen:
The request never completes (times out)
iOS allocates a crazy amount of memory, with hundred of thousands of CTHTTPMessage and HTTP2StreamBridge objects being allocated by CFNetwork (see screenshot from the debug memory graph in Xcode)
(Of course, neither of these things happens when netfox is not active)
I've tracked this issue to the getNFXBody() method in NFXHelper.swift and the readfully() method; specifically, this line:
calls readfully(), which proceeds to read the contents of the httpBodyStream object. Note that calling read() on httpBodyStream is discouraged by Apple's docs on the httpBodyStream object, which say:
The stream is returned for examination only; it’s unsafe for the caller to manipulate the stream in any way.
Modifying readfully() to simply return an empty data object makes this issue go away.
The text was updated successfully, but these errors were encountered:
We have an app that uploads a file via a POST request by doing something like:
Executing code like this when netfox is active causes several bad things to happen:
(Of course, neither of these things happens when netfox is not active)
I've tracked this issue to the getNFXBody() method in NFXHelper.swift and the readfully() method; specifically, this line:
return httpBodyStream?.readfully() ?? URLProtocol.property(forKey: "NFXBodyData", in: self) as? Data ?? Data()
calls readfully(), which proceeds to read the contents of the httpBodyStream object. Note that calling read() on httpBodyStream is discouraged by Apple's docs on the httpBodyStream object, which say:
Modifying readfully() to simply return an empty data object makes this issue go away.
The text was updated successfully, but these errors were encountered: