فهرست منبع

- fixed compilation without tcp support (no -DUSE_TCP)

Andrei Pelinescu-Onciul 17 سال پیش
والد
کامیت
7ad18de88e
3فایلهای تغییر یافته به همراه6 افزوده شده و 4 حذف شده
  1. 2 2
      core_cmd.c
  2. 2 2
      main.c
  3. 2 0
      tcp_options.h

+ 2 - 2
core_cmd.c

@@ -525,8 +525,8 @@ static const char* core_tcpinfo_doc[] = {
 
 static void core_tcpinfo(rpc_t* rpc, void* c)
 {
-	void *handle;
 #ifdef USE_TCP
+	void *handle;
 	struct tcp_gen_info ti;
 
 	if (!tcp_disable){
@@ -555,8 +555,8 @@ static const char* core_tcp_options_doc[] = {
 
 static void core_tcp_options(rpc_t* rpc, void* c)
 {
-	void *handle;
 #ifdef USE_TCP
+	void *handle;
 	struct tcp_cfg_options t;
 
 	if (!tcp_disable){

+ 2 - 2
main.c

@@ -479,10 +479,10 @@ void cleanup(show_status)
 	cfg_destroy();
 #ifdef USE_TCP
 	destroy_tcp();
-#endif
 #ifdef USE_TLS
 	destroy_tls();
-#endif
+#endif /* USE_TLS */
+#endif /* USE_TCP */
 	destroy_timer();
 	destroy_script_cb();
 	destroy_nonsip_hooks();

+ 2 - 0
tcp_options.h

@@ -26,6 +26,7 @@
 #ifndef tcp_options_h
 #define tcp_options_h
 
+#ifdef USE_TCP
 
 #ifndef NO_TCP_BUF_WRITE
 #define TCP_BUF_WRITE /* enabled buffered writing */
@@ -106,6 +107,7 @@
 #endif /* __OS_ */
 #endif /* NO_TCP_QUICKACK */
 
+#endif /* USE_TCP */
 
 struct tcp_cfg_options{
 	/* ser tcp options */