New issue
Advanced search Search tips

Issue 856349 link

Starred by 3 users

Issue metadata

Status: WontFix
Owner:
Closed: Dec 4
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: iOS
Pri: 1
Type: Bug

Blocking:
issue 852432



Sign in to add a comment

Delegate method didSendBodyData is never called

Project Member Reported by kapishnikov@chromium.org, Jun 25 2018

Issue description

When Cronet is enabled and used for uploading data, callback  URLSession:task:didSendBodyData:totalBytesSent:totalBytesExpectedToSend: is never called. The behavior is the same regardless whether the Cronet metrics is enabled or not.
 
Cc: mef@chromium.org
It looks that it is something that is not currently supported by NSURLProtocol API in general.

Here is a quote from Apple documentation(1):
"Similarly, there is no way for your NSURLProtocol subclass to call the NSURLConnection delegate's -connection:needNewBodyStream: or -connection:didSendBodyData:totalBytesWritten:totalBytesExpectedToWrite: methods (<rdar://problem/9226155> and <rdar://problem/9226157>).  The latter is not a serious concern--it just means that your clients don't get upload progress--but the former is a real issue.  If you're in a situation where you might need a second copy of a request body, you will need your own logic to make that copy, including the case where the body is a stream."

This issue is also related to the request timing out when data cannot be uploaded within 60 second interval; because there is no way for a NSURLProtocol implementation to notify the CFNetwork stack about the upload progress. 

(1): https://developer.apple.com/library/archive/samplecode/CustomHTTPProtocol/Listings/Read_Me_About_CustomHTTPProtocol_txt.html
Owner: mef@chromium.org
Status: Assigned (was: Untriaged)
Blocking: 852432
Status: WontFix (was: Assigned)
This is limitation of NSURLProtocol API that unfortunately cannot be addressed by Cronet.

Sign in to add a comment