From 5372a8b376714ed2538d6c27b00a10c12f65d952 Mon Sep 17 00:00:00 2001 From: levlam Date: Thu, 30 Jun 2022 16:02:07 +0300 Subject: [PATCH] Fix DarwinHttp. --- tdnet/td/net/DarwinHttp.mm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tdnet/td/net/DarwinHttp.mm b/tdnet/td/net/DarwinHttp.mm index 6cb25aac9..f8e285433 100644 --- a/tdnet/td/net/DarwinHttp.mm +++ b/tdnet/td/net/DarwinHttp.mm @@ -7,6 +7,7 @@ #include "td/net/DarwinHttp.h" #include "td/utils/logging.h" +#include "td/utils/SliceBuilder.h" #import @@ -47,9 +48,9 @@ void http_send(NSURLRequest *request, Promise promise) { completionHandler: ^(NSData *data, NSURLResponse *response, NSError *error) { if (error == nil) { - callback(BufferSlice(Slice((const char *)([data bytes]), [data length]))); + callback.set_value(BufferSlice(Slice((const char *)([data bytes]), [data length]))); } else { - callback(Status::Error(static_cast([error code]), "HTTP request failed")); + callback.set_error(Status::Error(static_cast([error code]), "HTTP request failed")); } }]; [dataTask resume];