Changeset 10260
- Timestamp:
- 01/22/15 12:49:46 (9 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/module-anticasc.c
r10255 r10260 15 15 #define cs_ac "oscam.ac" 16 16 17 FILE *ac_log = NULL; 18 19 //static time_t ac_last_chk; 17 static FILE *ac_log; 20 18 static uchar ac_ecmd5[CS_ECMSTORESIZE]; 19 20 bool anticasc_logging(char *txt) 21 { 22 const char acasc_ident[] = "acasc: "; 23 if (!ac_log) 24 return false; 25 char *acasc_found = strstr(txt, acasc_ident); 26 if (acasc_found) 27 { 28 fprintf(ac_log, "%s\n", acasc_found + strlen(acasc_ident) + 1); 29 fflush(ac_log); 30 return true; 31 } 32 return false; 33 } 21 34 22 35 static int32_t ac_init_log(void) -
trunk/module-anticasc.h
r10232 r10260 12 12 extern void insert_zaplist(ECM_REQUEST *er, struct s_client *client); 13 13 static inline bool acosc_enabled(void) { return cfg.acosc_enabled; } 14 extern bool anticasc_logging(char *txt); 14 15 #else 15 16 static inline void ac_init(void) { } … … 22 23 static inline void insert_zaplist(ECM_REQUEST *UNUSED(er), struct s_client *UNUSED(client)) { } 23 24 static inline bool acosc_enabled(void) { return 0; } 25 static inline bool anticasc_logging(char *UNUSED(txt)) { return 0; } 24 26 #endif 25 27 -
trunk/oscam-log.c
r10254 r10260 1 1 #include "globals.h" 2 2 #include <syslog.h> 3 #include "module-anticasc.h" 3 4 #include "module-monitor.h" 4 5 #include "oscam-client.h" … … 306 307 (void)log; // Prevent warning when WEBIF, MODULE_MONITOR and CS_ANTICASC are disabled 307 308 308 #ifdef CS_ANTICASC 309 extern FILE *ac_log; 310 char *acasc_found = strstr(txt + log->header_len, "acasc: "); 311 if(ac_log && acasc_found) 312 { 313 strcat(txt, "\n"); 314 fprintf(ac_log, "%s\n", acasc_found + 8); 315 fflush(ac_log); 316 } 317 else 318 #endif 309 // anticascading messages go to their own log 310 if (!anticasc_logging(txt + log->header_len)) 319 311 { 320 312 if(cfg.logtosyslog)
Note:
See TracChangeset
for help on using the changeset viewer.