Changeset 9876
- Timestamp:
- 09/28/14 18:30:52 (10 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/module-dvbapi.c
r9870 r9876 103 103 static int32_t selected_api = -1; 104 104 static int32_t dir_fd = -1; 105 char *client_name = NULL; 105 106 static uint16_t client_proto_version = 0; 106 107 … … 3927 3928 connfd = -1; 3928 3929 client_proto_version = 0; 3930 if (client_name) 3931 { 3932 free(client_name); 3933 client_name = NULL; 3934 } 3929 3935 if (cfg.dvbapi_listenport) 3930 3936 { … … 4006 4012 uint16_t *client_proto_ptr = (uint16_t *) &mbuf[4]; 4007 4013 uint16_t client_proto = ntohs(*client_proto_ptr); 4008 char client_name[data_len + 1]; 4009 memcpy(&client_name, &mbuf[7], data_len); 4010 client_name[data_len] = 0; 4011 cs_log("[DVBAPI] Client connected: '%s' (protocol version = %d)", client_name, client_proto); 4014 if (client_name) 4015 free(client_name); 4016 if (cs_malloc(&client_name, data_len + 1)) 4017 { 4018 memcpy(client_name, &mbuf[7], data_len); 4019 client_name[data_len] = 0; 4020 cs_log("[DVBAPI] Client connected: '%s' (protocol version = %d)", client_name, client_proto); 4021 } 4012 4022 client_proto_version = client_proto; //setting the global var according to the client 4013 4023 … … 4960 4970 } 4961 4971 4972 const char *dvbapi_get_client_name() 4973 { 4974 return client_name; 4975 } 4976 4962 4977 /* 4963 4978 * protocol structure -
trunk/module-dvbapi.h
r9869 r9876 280 280 void disable_unused_streampids(int16_t demux_id); 281 281 int8_t is_ca_used(uint8_t cadevice); 282 const char *dvbapi_get_client_name(); 282 283 283 284 #ifdef DVBAPI_LOG_PREFIX -
trunk/module-webif.c
r9872 r9876 3044 3044 } 3045 3045 } 3046 return; 3047 } 3048 #endif 3049 #ifdef HAVE_DVBAPI 3050 if(streq(proto, "dvbapi") && cl->typ == 'c' && dvbapi_get_client_name()) 3051 { 3052 tpl_printf(vars, TPLADD, "CLIENTPROTO", "%s (%s)", proto, dvbapi_get_client_name()); 3053 tpl_printf(vars, TPLADD, "CLIENTPROTOSORT", "%s (%s)", proto, dvbapi_get_client_name()); 3046 3054 return; 3047 3055 }
Note:
See TracChangeset
for help on using the changeset viewer.