diff --git a/src/mhd2/daemon_add_conn.c b/src/mhd2/daemon_add_conn.c index 97c65514..15a9986e 100644 --- a/src/mhd2/daemon_add_conn.c +++ b/src/mhd2/daemon_add_conn.c @@ -470,11 +470,11 @@ new_connection_process_ (struct MHD_Daemon *restrict daemon, #ifdef mhd_DEBUG_CONN_ADD_CLOSE if (MHD_SC_OK == res) fprintf (stderr, - "&&& Added new connection, FD: %llu\n", + "&&& Added new connection, FD: %2llu\n", (unsigned long long) connection->sk.fd); else fprintf (stderr, - "&&& Failed add connection, FD: %llu -> %u\n", + "&&& Failed add connection, FD: %2llu -> %u\n", (unsigned long long) connection->sk.fd, (unsigned int) res); #endif /* mhd_DEBUG_CONN_ADD_CLOSE */ @@ -1114,7 +1114,7 @@ mhd_conn_close_final (struct MHD_Connection *restrict c) mhd_socket_close (c->sk.fd); #ifdef mhd_DEBUG_CONN_ADD_CLOSE fprintf (stderr, - "&&& Closed connection, FD: %llu\n", + "&&& Closed connection, FD: %2llu\n", (unsigned long long) c->sk.fd); #endif /* mhd_DEBUG_CONN_ADD_CLOSE */ diff --git a/src/mhd2/daemon_event_update.c b/src/mhd2/daemon_event_update.c index 7f4f1894..b65b1d6e 100644 --- a/src/mhd2/daemon_event_update.c +++ b/src/mhd2/daemon_event_update.c @@ -77,19 +77,19 @@ MHD_daemon_event_update ( break; case mhd_SOCKET_REL_MARKER_ITC: fprintf (stderr, - "### MHD_daemon_event_update(daemon, [ITC: %llu], %s)\n", + "### MHD_daemon_event_update(daemon, [ITC: %2llu], %s)\n", (unsigned long long) mhd_itc_r_fd (daemon->threading.itc), state_str); break; case mhd_SOCKET_REL_MARKER_LISTEN: fprintf (stderr, - "### MHD_daemon_event_update(daemon, [lstn: %llu], %s)\n", + "### MHD_daemon_event_update(daemon, [lstn: %2llu], %s)\n", (unsigned long long) daemon->net.listen.fd, state_str); break; default: fprintf (stderr, - "### MHD_daemon_event_update(daemon, [conn: %llu], %s)\n", + "### MHD_daemon_event_update(daemon, [conn: %2llu], %s)\n", (unsigned long long) (((struct MHD_Connection *) ecb_cntx)->sk.fd), state_str); diff --git a/src/mhd2/events_process.c b/src/mhd2/events_process.c index b9d6a829..340f85b4 100644 --- a/src/mhd2/events_process.c +++ b/src/mhd2/events_process.c @@ -70,7 +70,7 @@ #include "mhd_public_api.h" -#if mhd_DEBUG_POLLING_FDS +#ifdef mhd_DEBUG_POLLING_FDS /** * Debug-printf request of FD polling/monitoring * @param fd_name the name of FD ("ITC", "lstn" or "conn") @@ -92,7 +92,7 @@ mhd_dbg_print_fd_mon_req (const char *fd_name, state_str[4] = e_ready ? 'E' : '-'; fprintf (stderr, - "### Set FD watching: %4s [%llu] for %s\n", + "### Set FD watching: %4s [%2llu] for %s\n", fd_name, (unsigned long long) fd, state_str); @@ -120,7 +120,7 @@ dbg_print_fd_state_update (const char *fd_name, state_str[4] = e_ready ? 'E' : '-'; fprintf (stderr, - "### FD state update: %4s [%llu] -> %s\n", + "### FD state update: %4s [%2llu] -> %s\n", fd_name, (unsigned long long) fd, state_str); @@ -128,8 +128,8 @@ dbg_print_fd_state_update (const char *fd_name, #else /* ! mhd_DEBUG_POLLING_FDS */ -# defined dbg_print_fd_state_update (fd_n,fd,r_ready,w_ready,e_ready) ((void) 0 \ - ) +# define dbg_print_fd_state_update(fd_n,fd,r_ready,w_ready,e_ready) \ + ((void) 0) #endif /* ! mhd_DEBUG_POLLING_FDS */ /** @@ -207,7 +207,7 @@ start_resuming_connection (struct MHD_Connection *restrict c, mhd_assert (c->suspended); #ifdef mhd_DEBUG_SUSPEND_RESUME fprintf (stderr, - "%%%%%% Resuming connection, FD: %llu\n", + "%%%%%% Resuming connection, FD: %2llu\n", (unsigned long long) c->sk.fd); #endif /* mhd_DEBUG_SUSPEND_RESUME */ c->suspended = false; @@ -1078,7 +1078,7 @@ get_all_net_updates_by_select_and_resume_conn (struct MHD_Daemon *restrict d, tmvl.tv_usec = (int) ((max_wait % 1000) * 1000); #endif -#if mhd_DEBUG_POLLING_FDS +#ifdef mhd_DEBUG_POLLING_FDS fprintf (stderr, "### (Starting) select(%d, rfds, wfds, efds, [%llu, %llu])...\n", max_socket + 1, @@ -1090,7 +1090,7 @@ get_all_net_updates_by_select_and_resume_conn (struct MHD_Daemon *restrict d, d->events.data.select.wfds, d->events.data.select.efds, &tmvl); -#if mhd_DEBUG_POLLING_FDS +#ifdef mhd_DEBUG_POLLING_FDS fprintf (stderr, "### (Finished) select(%d, rfds, wfds, efds, ->[%llu, %llu]) -> " "%d\n", @@ -1383,7 +1383,7 @@ static MHD_FN_PAR_NONNULL_ (1) bool get_all_net_updates_by_poll (struct MHD_Daemon *restrict d, bool listen_only) { -#if mhd_DEBUG_POLLING_FDS +#ifdef mhd_DEBUG_POLLING_FDS # ifdef MHD_SOCKETS_KIND_POSIX static const char poll_fn_name[] = "poll"; # else /* MHD_SOCKETS_KIND_WINSOCK */ @@ -1401,7 +1401,7 @@ get_all_net_updates_by_poll (struct MHD_Daemon *restrict d, // TODO: handle empty list situation max_wait = get_max_wait (d); // TODO: use correct timeout value -#if mhd_DEBUG_POLLING_FDS +#ifdef mhd_DEBUG_POLLING_FDS fprintf (stderr, "### (Starting) %s(fds, %u, %d)...\n", poll_fn_name, @@ -1411,7 +1411,7 @@ get_all_net_updates_by_poll (struct MHD_Daemon *restrict d, num_events = mhd_poll (d->events.data.poll.fds, num_fds, max_wait); // TODO: use correct timeout value -#if mhd_DEBUG_POLLING_FDS +#ifdef mhd_DEBUG_POLLING_FDS fprintf (stderr, "### (Finished) %s(fds, %u, %d) -> %d\n", poll_fn_name, @@ -1580,7 +1580,7 @@ get_all_net_updates_by_epoll (struct MHD_Daemon *restrict d) max_wait = get_max_wait (d); // TODO: use correct timeout value do { -#if mhd_DEBUG_POLLING_FDS +#ifdef mhd_DEBUG_POLLING_FDS fprintf (stderr, "### (Starting) epoll_wait(%d, events, %d, %d)...\n", d->events.data.epoll.e_fd, @@ -1591,7 +1591,7 @@ get_all_net_updates_by_epoll (struct MHD_Daemon *restrict d) d->events.data.epoll.events, (int) d->events.data.epoll.num_elements, max_wait); -#if mhd_DEBUG_POLLING_FDS +#ifdef mhd_DEBUG_POLLING_FDS fprintf (stderr, "### (Finished) epoll_wait(%d, events, %d, %d) -> %d\n", d->events.data.epoll.e_fd, @@ -1758,7 +1758,7 @@ MHD_daemon_process_reg_events (struct MHD_Daemon *MHD_RESTRICT daemon, enum MHD_StatusCode res; #ifdef mhd_DEBUG_POLLING_FDS fprintf (stderr, - "### (Started) MHD_daemon_process_reg_events(daemon, [%s])...\n", + "### (Starting) MHD_daemon_process_reg_events(daemon, [%s])...\n", (NULL != next_max_wait) ? "non-NULL" : "NULL"); #endif res = process_reg_events_int (daemon, diff --git a/src/mhd2/extr_events_funcs.h b/src/mhd2/extr_events_funcs.h index f89eac07..40c892cb 100644 --- a/src/mhd2/extr_events_funcs.h +++ b/src/mhd2/extr_events_funcs.h @@ -112,7 +112,7 @@ mhd_daemon_extr_event_reg (struct MHD_Daemon *d, break; } fprintf (stderr, - "### %s callback (cls, [%s %llu], %s, 0x%08llX, ptr) " + "### %s callback (cls, [%s %2llu], %s, 0x%08llX, ptr) " "-> 0x%08llX\n", reg_type, fd_rel, diff --git a/src/mhd2/mhd_dbg_print.h b/src/mhd2/mhd_dbg_print.h index ea7e330a..d8cf159e 100644 --- a/src/mhd2/mhd_dbg_print.h +++ b/src/mhd2/mhd_dbg_print.h @@ -35,7 +35,7 @@ #endif /* mhd_DEBUG_POLLING_FDS */ -#if mhd_DEBUG_POLLING_FDS +#ifdef mhd_DEBUG_POLLING_FDS /** * Debug-printf request of FD polling/monitoring * @param fd_name the name of FD ("ITC", "lstn" or "conn") @@ -54,7 +54,7 @@ mhd_dbg_print_fd_mon_req (const char *fd_name, MHD_FN_PAR_NONNULL_ALL_; #else /* ! mhd_DEBUG_POLLING_FDS */ -# define dbg_print_fd_state_update(fd_n,fd,r_ready,w_ready,e_ready) ((void) 0) +# define mhd_dbg_print_fd_mon_req(fd_n,fd,r_ready,w_ready,e_ready) ((void) 0) #endif /* ! mhd_DEBUG_POLLING_FDS */ diff --git a/src/mhd2/request_resume.c b/src/mhd2/request_resume.c index 47531394..cdb1a647 100644 --- a/src/mhd2/request_resume.c +++ b/src/mhd2/request_resume.c @@ -51,7 +51,7 @@ MHD_request_resume (struct MHD_Request *request) { #ifdef mhd_DEBUG_SUSPEND_RESUME fprintf (stderr, - "%%%%%% Requested conn resume, FD: %llu -> " + "%%%%%% Requested conn resume, FD: %2llu -> " "failed as not suspended\n", (unsigned long long) c->sk.fd); #endif /* mhd_DEBUG_SUSPEND_RESUME */ @@ -60,7 +60,7 @@ MHD_request_resume (struct MHD_Request *request) c->resuming = true; #ifdef mhd_DEBUG_SUSPEND_RESUME fprintf (stderr, - "%%%%%% Requested conn resume, FD: %llu\n", + "%%%%%% Requested conn resume, FD: %2llu\n", (unsigned long long) c->sk.fd); #endif /* mhd_DEBUG_SUSPEND_RESUME */ d->threading.resume_requested = true; diff --git a/src/mhd2/stream_funcs.c b/src/mhd2/stream_funcs.c index bf1772b3..59346a2e 100644 --- a/src/mhd2/stream_funcs.c +++ b/src/mhd2/stream_funcs.c @@ -1030,7 +1030,7 @@ mhd_conn_pre_clean (struct MHD_Connection *restrict c) { #ifdef mhd_DEBUG_CONN_ADD_CLOSE fprintf (stderr, - "&&& Closing connection, FD: %llu\n", + "&&& Closing connection, FD: %2llu\n", (unsigned long long) c->sk.fd); #endif /* mhd_DEBUG_CONN_ADD_CLOSE */ diff --git a/src/mhd2/stream_process_request.c b/src/mhd2/stream_process_request.c index b6e87c2f..06298053 100644 --- a/src/mhd2/stream_process_request.c +++ b/src/mhd2/stream_process_request.c @@ -3008,7 +3008,7 @@ mhd_stream_call_app_request_cb (struct MHD_Connection *restrict c) c->suspended = true; #ifdef mhd_DEBUG_SUSPEND_RESUME fprintf (stderr, - "%%%%%% Suspending connection, FD: %llu\n", + "%%%%%% Suspending connection, FD: %2llu\n", (unsigned long long) c->sk.fd); #endif /* mhd_DEBUG_SUSPEND_RESUME */ c->rq.app_act.head_act.act = mhd_ACTION_NO_ACTION; @@ -3075,7 +3075,7 @@ mhd_stream_process_upload_action (struct MHD_Connection *restrict c, c->suspended = true; #ifdef mhd_DEBUG_SUSPEND_RESUME fprintf (stderr, - "%%%%%% Suspending connection, FD: %llu\n", + "%%%%%% Suspending connection, FD: %2llu\n", (unsigned long long) c->sk.fd); #endif /* mhd_DEBUG_SUSPEND_RESUME */ memset (&(c->rq.app_act.upl_act), 0, sizeof(c->rq.app_act.upl_act)); diff --git a/src/mhd2/stream_process_states.c b/src/mhd2/stream_process_states.c index 3afe3b06..d33dcc84 100644 --- a/src/mhd2/stream_process_states.c +++ b/src/mhd2/stream_process_states.c @@ -195,7 +195,7 @@ finish_resume (struct MHD_Connection *restrict c) #ifdef mhd_DEBUG_SUSPEND_RESUME fprintf (stderr, - "%%%%%% Resumed connection, FD: %llu\n", + "%%%%%% Resumed connection, FD: %2llu\n", (unsigned long long) c->sk.fd); #endif /* mhd_DEBUG_SUSPEND_RESUME */ mhd_assert (! c->suspended); @@ -537,7 +537,7 @@ mhd_conn_process_data (struct MHD_Connection *restrict c) mhd_conn_remove_from_timeout_lists (c); #ifdef mhd_DEBUG_SUSPEND_RESUME fprintf (stderr, - "%%%%%% Connection suspended, FD: %llu\n", + "%%%%%% Connection suspended, FD: %2llu\n", (unsigned long long) c->sk.fd); #endif /* mhd_DEBUG_SUSPEND_RESUME */ return true;