Skip to content

Commit

Permalink
debug: add some info
Browse files Browse the repository at this point in the history
Signed-off-by: Dengfeng Liu <[email protected]>
  • Loading branch information
liudf0716 committed Jul 9, 2024
1 parent 9d541df commit de4567d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
7 changes: 5 additions & 2 deletions src/http.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ process_apple_wisper(struct evhttp_request *req, const char *mac, const char *re
*
* @param req The http request
* @param type 1: internet not online
* other: auth server ont online
* other: auth server offline
*/
void
ev_http_reply_client_error(struct evhttp_request *req, enum reply_client_error_type type)
Expand Down Expand Up @@ -239,12 +239,15 @@ void
ev_http_callback_404(struct evhttp_request *req, void *arg)
{
if (!is_online()) {
debug(LOG_INFO, "Internet is offline");
ev_http_reply_client_error(req, INTERNET_OFFLINE);
return;
}

if (!is_auth_online()) {
ev_http_reply_client_error(req, AUTHSERVER_OFFLINE);
debug(LOG_INFO, "Auth server is offline");
//ev_http_reply_client_error(req, AUTHSERVER_OFFLINE);
evhttp_send_error(req, 200, "Auth server is offline");
return;
}

Expand Down
3 changes: 2 additions & 1 deletion src/ping_thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,8 @@ process_ping_response(struct evhttp_request *req, void *ctx)
}
} else if (strstr(buffer, "Pong") == 0) {
mark_auth_offline();
debug(LOG_WARNING, "Auth server did NOT say Pong!");
debug(LOG_WARNING, "Auth server did NOT say Pong! the response [%s], error: %s",
buffer, strerror(errno));
if (!authdown) {
fw_set_authdown();
authdown = 1;
Expand Down
3 changes: 2 additions & 1 deletion src/wd_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,8 @@ wd_make_request(struct wd_request_context *request_ctx,
struct bufferevent *bev = request_ctx->bev;
struct event_base *base = request_ctx->base;
t_auth_serv *auth_server = get_auth_server();


debug(LOG_DEBUG, "auth_server->authserv_use_ssl: %d", auth_server->authserv_use_ssl);
if (!auth_server->authserv_use_ssl) {
*evcon = evhttp_connection_base_bufferevent_new(base, NULL, bev,
auth_server->authserv_hostname, auth_server->authserv_http_port);
Expand Down

0 comments on commit de4567d

Please sign in to comment.