mirror of
https://github.com/tsl0922/ttyd.git
synced 2025-12-27 22:14:23 +01:00
Reformat C source files
This commit is contained in:
10
src/http.c
10
src/http.c
@@ -82,7 +82,7 @@ callback_http(struct lws *wsi, enum lws_callback_reasons reason, void *user, voi
|
||||
p = buffer + LWS_PRE;
|
||||
end = p + sizeof(buffer) - LWS_PRE;
|
||||
|
||||
if (!strncmp((const char *)in, "/auth_token.js", 14)) {
|
||||
if (!strncmp((const char *) in, "/auth_token.js", 14)) {
|
||||
size_t n = server->credential != NULL ? sprintf(buf, "var tty_auth_token = '%s';", server->credential) : 0;
|
||||
|
||||
if (lws_add_http_header_status(wsi, HTTP_STATUS_OK, &p, end))
|
||||
@@ -128,10 +128,10 @@ callback_http(struct lws *wsi, enum lws_callback_reasons reason, void *user, voi
|
||||
return 1;
|
||||
goto try_to_reuse;
|
||||
case LWS_CALLBACK_OPENSSL_PERFORM_CLIENT_CERT_VERIFICATION:
|
||||
if (!len || (SSL_get_verify_result((SSL*)in) != X509_V_OK)) {
|
||||
int err = X509_STORE_CTX_get_error((X509_STORE_CTX*)user);
|
||||
int depth = X509_STORE_CTX_get_error_depth((X509_STORE_CTX*)user);
|
||||
const char* msg = X509_verify_cert_error_string(err);
|
||||
if (!len || (SSL_get_verify_result((SSL *) in) != X509_V_OK)) {
|
||||
int err = X509_STORE_CTX_get_error((X509_STORE_CTX *) user);
|
||||
int depth = X509_STORE_CTX_get_error_depth((X509_STORE_CTX *) user);
|
||||
const char *msg = X509_verify_cert_error_string(err);
|
||||
lwsl_err("client certificate verification error: %s (%d), depth: %d\n", msg, err, depth);
|
||||
return 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user