Skip to content

Commit 5607a88

Browse files
committed
fix: add error handling and documentation for tcp_mux_flag function
Signed-off-by: Dengfeng Liu <liudf0716@gmail.com>
1 parent 313bec4 commit 5607a88

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

tcpmux.c

+14
Original file line numberDiff line numberDiff line change
@@ -204,8 +204,22 @@ void tcp_mux_encode(enum tcp_mux_type type, enum tcp_mux_flag flags,
204204
*
205205
* @return The TCP multiplexing flag as a 32-bit unsigned integer.
206206
*/
207+
/**
208+
* @brief Gets the TCP multiplexing configuration flag.
209+
*
210+
* Retrieves the TCP multiplexing flag from the common configuration.
211+
* This flag determines whether TCP multiplexing is enabled for the
212+
* current session.
213+
*
214+
* @return The TCP multiplexing flag value from configuration
215+
* Returns 0 if configuration is not available
216+
*/
207217
static uint32_t tcp_mux_flag() {
208218
struct common_conf *c_conf = get_common_config();
219+
if (!c_conf) {
220+
debug(LOG_ERR, "Failed to get common configuration");
221+
return 0;
222+
}
209223
return c_conf->tcp_mux;
210224
}
211225

0 commit comments

Comments
 (0)