bbennett-ks commented on code in PR #627:
URL: https://github.com/apache/guacamole-server/pull/627#discussion_r2615447122
##########
src/protocols/vnc/vnc.c:
##########
@@ -361,13 +361,12 @@ void* guac_vnc_client_thread(void* data) {
*/
if (settings->wol_wait_time > 0) {
guac_client_log(client, GUAC_LOG_DEBUG, "Sending Wake-on-LAN
packet, "
- "and pausing for %d seconds.", settings->wol_wait_time);
+ "and retrying connection check %d times every %d seconds.",
+ GUAC_WOL_DEFAULT_CONNECT_RETRIES, settings->wol_wait_time);
- /* char representation of a port should be, at most, 5 characters
plus terminator. */
- char* str_port = guac_mem_alloc(6);
- if (guac_itoa(str_port, settings->port) < 1) {
- guac_client_log(client, GUAC_LOG_ERROR, "Failed to convert
port to integer for WOL function.");
- guac_mem_free(str_port);
+ char str_port[GUAC_WOL_PORT_STRLEN];
Review Comment:
Just the overhead of unnecessarily allocating & free a small memory
allocation when a stack allocation satisfies the lifetime requirements.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]