2022-11-07 06:21:24 +00:00
|
|
|
//
|
|
|
|
// Created by xajhuang on 2022/11/4.
|
|
|
|
//
|
|
|
|
#include "http_svr.h"
|
|
|
|
#include "user_errno.h"
|
|
|
|
#include "haywire.h"
|
2022-11-07 06:38:30 +00:00
|
|
|
#include "config.h"
|
2022-11-07 06:21:24 +00:00
|
|
|
|
|
|
|
int http_svr_init() {
|
|
|
|
configuration config;
|
2022-11-07 06:38:30 +00:00
|
|
|
config.http_listen_address = (char*)config_get_http_server_addr();
|
|
|
|
config.http_listen_port = config_get_http_server_port();
|
2022-11-07 06:21:24 +00:00
|
|
|
config.thread_count = 0;
|
|
|
|
config.parser = "http_parser";
|
|
|
|
config.balancer = "ipc";
|
2022-11-07 06:38:30 +00:00
|
|
|
config.tcp_nodelay = config_get_http_server_tcp_nodelay();
|
2022-11-07 06:21:24 +00:00
|
|
|
config.max_request_size = 1048576;
|
|
|
|
|
|
|
|
hw_init_with_config(&config);
|
|
|
|
|
|
|
|
hw_http_open();
|
|
|
|
return ERR_SUCCESS;
|
|
|
|
}
|