Show connection flag "s" (SSL) in RPL_TRACE{LINK|SERVER}

Now you can check if a server-to-server link is SSL-encrypted or not
using the IRC "TRACE" command.

Idea by Götz Hoffart, thanks!
This commit is contained in:
Alexander Barton 2013-08-31 14:15:09 +02:00
parent be2e611680
commit 04b947cdc3
1 changed files with 17 additions and 5 deletions

View File

@ -450,6 +450,12 @@ Help(CLIENT *Client, const char *Topic)
return CONNECTED; return CONNECTED;
} }
/**
* Get pointer to a static string representing the connection "options".
*
* @param Idx Connection index.
* @return Pointer to static (global) string buffer.
*/
static char * static char *
#ifdef ZLIB #ifdef ZLIB
Option_String(CONN_ID Idx) Option_String(CONN_ID Idx)
@ -460,16 +466,22 @@ Option_String(UNUSED CONN_ID Idx)
static char option_txt[8]; static char option_txt[8];
#ifdef ZLIB #ifdef ZLIB
UINT16 options; UINT16 options;
#endif
assert(Idx != NONE);
options = Conn_Options(Idx); options = Conn_Options(Idx);
#endif
strcpy(option_txt, "F"); /* No idea what this means, but the strcpy(option_txt, "F"); /* No idea what this means, but the
* original ircd sends it ... */ * original ircd sends it ... */
#ifdef ZLIB #ifdef SSL_SUPPORT
if(options & CONN_ZIP) /* zlib compression supported. */ if(options & CONN_SSL) /* SSL encrypted link */
strcat(option_txt, "z"); strlcat(option_txt, "s", sizeof(option_txt));
#endif #endif
#ifdef ZLIB
if(options & CONN_ZIP) /* zlib compression enabled */
strlcat(option_txt, "z", sizeof(option_txt));
#endif
LogDebug(" *** %d: %d = %s", Idx, options, option_txt);
return option_txt; return option_txt;
} /* Option_String */ } /* Option_String */