We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
md5: 961cc02a2b082602c3cf7791b69806ca
Issue Description:
import Foundation import Dispatch class HTTPUploadDelegate: NSObject { var totalBytesSent: Int64 = 0 } extension HTTPUploadDelegate: URLSessionTaskDelegate { func urlSession(_ session: URLSession, task: URLSessionTask, didSendBodyData bytesSent: Int64, totalBytesSent: Int64, totalBytesExpectedToSend: Int64) { self.totalBytesSent = totalBytesSent } } extension HTTPUploadDelegate: URLSessionDataDelegate { func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive data: Data) { print("totalBytesSent = \(totalBytesSent)") exit(0) } } let session = URLSession(configuration: .default, delegate: HTTPUploadDelegate(), delegateQueue: nil) var request = URLRequest(url: URL(string: "http://posttestserver.com/post.php")!) request.httpMethod = "POST" let fileData = Data(count: 48*1024) let task = session.uploadTask(with: request, from: fileData) task.resume() dispatchMain()
Expected output (also, output on Darwin): totalBytesSent = 49152
Output on Linux: totalBytesSent = 0
The text was updated successfully, but these errors were encountered:
#1121
Sorry, something went wrong.
pushkarnk
No branches or pull requests
Additional Detail from JIRA
md5: 961cc02a2b082602c3cf7791b69806ca
Issue Description:
Expected output (also, output on Darwin):
totalBytesSent = 49152
Output on Linux:
totalBytesSent = 0
The text was updated successfully, but these errors were encountered: