diff --git a/net/http/client.h b/net/http/client.h index d2affab4..8df6f6f2 100644 --- a/net/http/client.h +++ b/net/http/client.h @@ -61,6 +61,10 @@ class Client : public Object { auto ptr = malloc(sizeof(Operation) + buf_size); return new (ptr) Operation(c, buf_size); } + static void delete_operation(Operation* op) { + op->~Operation(); + free(op); + } void set_enable_proxy(bool enable) { enable_proxy = enable; } int call() { @@ -90,6 +94,10 @@ class Client : public Object { return Operation::create(this, buf_size); } + void delete_operation(Operation* op) { + Operation::delete_operation(op); + } + template class OperationOnStack : public Operation { char _buf[BufferSize];