Skip to content

Commit

Permalink
update: all word 'tubekit' to 'avant'
Browse files Browse the repository at this point in the history
  • Loading branch information
gaowanlu committed Apr 27, 2024
1 parent 17fb71a commit 30d0922
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion bin/config/main.ini
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ accept_per_tick = 100
task_type = HTTP_TASK
# task_type = STREAM_TASK
# task_type = WEBSOCKET_TASK
http_static_dir = /tubekit_static
http_static_dir = /avant_static
lua_dir = ./lua
crt.pem = ./config/certificate.crt
key.pem = ./config/private_key.pem
Expand Down
2 changes: 1 addition & 1 deletion external/avant-redis/README.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
# tubekit-redis
# avant-redis
2 changes: 1 addition & 1 deletion external/avant-sql/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# tubekit-sql
# avant-sql

mysql function lib
8 changes: 4 additions & 4 deletions src/app/http_app.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ void http_app::process_connection(avant::connection::http_ctx &ctx)
ctx.process_callback = [](avant::connection::http_ctx &ctx) -> void
{
{
const char *response = "HTTP/1.1 200 OK\r\nServer: tubekit\r\nConnection: keep-alive\r\nKeep-Alive: timeout=60, max=10000\r\nContent-Type: text/plain; charset=UTF-8\r\nContent-Length: 5\r\n\r\nHELLO";
const char *response = "HTTP/1.1 200 OK\r\nServer: avant\r\nConnection: keep-alive\r\nKeep-Alive: timeout=60, max=10000\r\nContent-Type: text/plain; charset=UTF-8\r\nContent-Length: 5\r\n\r\nHELLO";
ctx.conn_ptr->send_buffer.append(response, strlen(response));
ctx.set_process_end(true);
return;
Expand Down Expand Up @@ -143,7 +143,7 @@ void http_app::process_connection(avant::connection::http_ctx &ctx)
{
mime_type = "application/octet-stream";
}
std::string response = "HTTP/1.1 200 OK\r\nServer: tubekit\r\n";
std::string response = "HTTP/1.1 200 OK\r\nServer: avant\r\n";
response += "Content-Type: ";
response += mime_type + "\r\n\r\n";

Expand Down Expand Up @@ -193,7 +193,7 @@ void http_app::process_connection(avant::connection::http_ctx &ctx)
}
auto dir_type_ptr = (http_app_reponse::DIR_TYPE *)response_ptr->ptr;

const char *response_head = "HTTP/1.1 200 OK\r\nServer: tubekit\r\nContent-Type: text/html; charset=UTF-8\r\n\r\n";
const char *response_head = "HTTP/1.1 200 OK\r\nServer: avant\r\nContent-Type: text/html; charset=UTF-8\r\n\r\n";
ctx.conn_ptr->send_buffer.append(response_head, strlen(response_head));

// generate dir list
Expand Down Expand Up @@ -244,7 +244,7 @@ void http_app::process_connection(avant::connection::http_ctx &ctx)
}
else
{
const char *response = "HTTP/1.1 404 Not Found\r\nServer: tubekit\r\nContent-Type: text/text; charset=UTF-8\r\n\r\n";
const char *response = "HTTP/1.1 404 Not Found\r\nServer: avant\r\nContent-Type: text/text; charset=UTF-8\r\n\r\n";
ctx.conn_ptr->send_buffer.append(response, strlen(response));
ctx.set_response_end(true);
}
Expand Down
10 changes: 5 additions & 5 deletions test/node_http_server.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ const url = require('url');
const path = require('path');

const staticRoot = async (staticPath, req, res) => {
res.writeHead(200,'OK');
res.end();
return;
res.writeHead(200, 'OK');
res.end();
return;

try {
try {
const pathObj = url.parse(req.url, true);
const filePath = path.join(staticPath, pathObj.pathname === '/' ? 'index.html' : pathObj.pathname);

Expand All @@ -25,7 +25,7 @@ const staticRoot = async (staticPath, req, res) => {
};

const server = http.createServer(async (req, res) => {
await staticRoot('/tubekit_static', req, res); // Use await for asynchronous function call
await staticRoot('/avant_static', req, res); // Use await for asynchronous function call
});

server.listen(20025, '0.0.0.0', () => {
Expand Down

0 comments on commit 30d0922

Please sign in to comment.