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];