Add 1st Real Rest Test.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
NADAL Jean-Baptiste
2020-01-22 11:46:06 +01:00
parent 3c9f0c2f56
commit 75eb680bd8
5 changed files with 86 additions and 26 deletions

View File

@@ -2,7 +2,7 @@ cmake_minimum_required (VERSION 3.0)
project (librestd)
add_definitions (-DBUILD_DEBUG)
add_definitions (-g -DBUILD_DEBUG)
include_directories (${CMAKE_SOURCE_DIR}/../libevent/include)
include_directories (${CMAKE_BINARY_DIR}/libevent/include)

View File

@@ -341,6 +341,9 @@ size_t restd_http_response(restd_conn_t *conn, int code, const char *contenttype
const void *data, off_t size)
{
restd_http_t *http = (restd_http_t *)restd_conn_get_extra(conn);
// Sanity Check
if (http == NULL)
return -1;
if (http->response.frozen_header)
{
return 0;

View File

@@ -536,7 +536,7 @@ static restd_conn_t *conn_new(restd_server_t *server, struct bufferevent *buffer
{
return NULL;
}
printf("conn_new\n");
// Create a new connection container.
restd_conn_t *conn = NEW_OBJECT(restd_conn_t);
if (conn == NULL)