mirror of
				https://github.com/3proxy/3proxy.git
				synced 2025-11-04 07:42:39 +08:00 
			
		
		
		
	ignore events on non-initialised log
This commit is contained in:
		
							parent
							
								
									b3a843aacb
								
							
						
					
					
						commit
						ca8788c65f
					
				
							
								
								
									
										18
									
								
								src/log.c
									
									
									
									
									
								
							
							
						
						
									
										18
									
								
								src/log.c
									
									
									
									
									
								
							@ -137,10 +137,12 @@ static void delayflushlogs(void){
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void flushlogs(void){
 | 
					void flushlogs(void){
 | 
				
			||||||
	struct logevent * evt;
 | 
						if(loginit){
 | 
				
			||||||
	evt = malloc(sizeof(struct logevent));
 | 
							struct logevent * evt;
 | 
				
			||||||
	evt->event = FLUSH;
 | 
							evt = malloc(sizeof(struct logevent));
 | 
				
			||||||
	logpush(evt);
 | 
							evt->event = FLUSH;
 | 
				
			||||||
 | 
							logpush(evt);
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -290,6 +292,14 @@ void * logthreadfunc (void *p) {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
void logpush(struct logevent *evt){
 | 
					void logpush(struct logevent *evt){
 | 
				
			||||||
	pthread_mutex_lock(&log_mutex);
 | 
						pthread_mutex_lock(&log_mutex);
 | 
				
			||||||
 | 
						if(!loginit){
 | 
				
			||||||
 | 
							if(evt->event == FREEPARAM){
 | 
				
			||||||
 | 
								delayfreeparam(evt->param);
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							myfree(evt);
 | 
				
			||||||
 | 
							pthread_mutex_unlock(&log_mutex);
 | 
				
			||||||
 | 
							return;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
	if(logtail) logtail->next = evt;
 | 
						if(logtail) logtail->next = evt;
 | 
				
			||||||
	logtail = evt;
 | 
						logtail = evt;
 | 
				
			||||||
	evt->next = NULL;
 | 
						evt->next = NULL;
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user