mirror of
https://github.com/tsl0922/ttyd.git
synced 2025-12-23 04:14:18 +01:00
Move source files to src
This commit is contained in:
@@ -3,7 +3,7 @@ set(CMAKE_C_STANDARD 99)
|
|||||||
|
|
||||||
project(ttyd)
|
project(ttyd)
|
||||||
|
|
||||||
set(SOURCE_FILES server.c http.c protocol.c utils.c)
|
set(SOURCE_FILES src/server.c src/http.c src/protocol.c src/utils.c)
|
||||||
|
|
||||||
find_package(OpenSSL REQUIRED)
|
find_package(OpenSSL REQUIRED)
|
||||||
find_package(Libwebsockets QUIET)
|
find_package(Libwebsockets QUIET)
|
||||||
@@ -33,7 +33,7 @@ mark_as_advanced(JSON-C_INCLUDE_DIR JSON-C_LIBRARY)
|
|||||||
find_program(CMAKE_XXD NAMES xxd)
|
find_program(CMAKE_XXD NAMES xxd)
|
||||||
add_custom_command(OUTPUT html.h
|
add_custom_command(OUTPUT html.h
|
||||||
COMMAND ${CMAKE_XXD} -i index.html html.h
|
COMMAND ${CMAKE_XXD} -i index.html html.h
|
||||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/src
|
||||||
COMMENT "Generating html.h from index.html")
|
COMMENT "Generating html.h from index.html")
|
||||||
list(APPEND SOURCE_FILES html.h)
|
list(APPEND SOURCE_FILES html.h)
|
||||||
|
|
||||||
|
|||||||
@@ -72,13 +72,13 @@ callback_http(struct lws *wsi, enum lws_callback_reasons reason, void *user, voi
|
|||||||
|
|
||||||
// TODO: this doesn't work for websocket
|
// TODO: this doesn't work for websocket
|
||||||
switch (check_auth(wsi)) {
|
switch (check_auth(wsi)) {
|
||||||
case 1:
|
case 0:
|
||||||
return 1;
|
break;
|
||||||
case -1:
|
case -1:
|
||||||
goto try_to_reuse;
|
goto try_to_reuse;
|
||||||
case 0:
|
case 1:
|
||||||
default:
|
default:
|
||||||
break;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// if a legal POST URL, let it continue and accept data
|
// if a legal POST URL, let it continue and accept data
|
||||||
0
index.html → src/index.html
vendored
0
index.html → src/index.html
vendored
@@ -111,7 +111,8 @@ calc_command_start(int argc, char **argv) {
|
|||||||
|
|
||||||
// do not print error message for invalid option
|
// do not print error message for invalid option
|
||||||
opterr = 0;
|
opterr = 0;
|
||||||
while (getopt_long(argc_copy, argv_copy, opt_string, options, NULL) != -1);
|
while (getopt_long(argc_copy, argv_copy, opt_string, options, NULL) != -1)
|
||||||
|
;
|
||||||
|
|
||||||
int start = -1;
|
int start = -1;
|
||||||
if (optind < argc) {
|
if (optind < argc) {
|
||||||
Reference in New Issue
Block a user