fix memory leak bugs

This commit is contained in:
崔一鸣
2018-09-07 17:42:57 +08:00
parent b6a2250786
commit b5a937bad6
10 changed files with 804 additions and 506 deletions

27
common/include/tfe_rpc.h Normal file
View File

@@ -0,0 +1,27 @@
#pragma once
#include "tfe_future.h"
#include "event2/event.h"
struct tfe_rpc_response_result{
int status_code;
const char* status_msg;
char* data;
int len;
};
enum TFE_RPC_FLAG
{
CHUNK_CB = 0,
DONE_CB,
};
enum TFE_RPC_METHOD
{
GET = 0,
POST,
};
struct tfe_rpc_response_result* tfe_rpc_release(void* result);
void tfe_rpc_async_ask(struct future* f, const char* url, enum TFE_RPC_METHOD method, enum TFE_RPC_FLAG flag, const char* data, int data_len, struct event_base * evbase);