| 
						
						
							
								
							
						
						
					 | 
					 | 
					@ -1494,6 +1494,7 @@ static void free_proxy(proxy_t *proxy) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					static void reap_proxies(ckpool_t *ckp, sdata_t *sdata) | 
					 | 
					 | 
					 | 
					static void reap_proxies(ckpool_t *ckp, sdata_t *sdata) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					{ | 
					 | 
					 | 
					 | 
					{ | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						proxy_t *proxy, *proxytmp, *subproxy, *subtmp; | 
					 | 
					 | 
					 | 
						proxy_t *proxy, *proxytmp, *subproxy, *subtmp; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
						int used = 0, dead = 0, retired = 0; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						if (!ckp->proxy) | 
					 | 
					 | 
					 | 
						if (!ckp->proxy) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							return; | 
					 | 
					 | 
					 | 
							return; | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -1509,11 +1510,9 @@ static void reap_proxies(ckpool_t *ckp, sdata_t *sdata) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									if (subproxy->clients < subproxy->max_clients) | 
					 | 
					 | 
					 | 
									if (subproxy->clients < subproxy->max_clients) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
										continue; | 
					 | 
					 | 
					 | 
										continue; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									generator_drop_proxy(ckp, subproxy->id, subproxy->subid); | 
					 | 
					 | 
					 | 
									generator_drop_proxy(ckp, subproxy->id, subproxy->subid); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									LOGNOTICE("Stratifier discarding used proxy %d:%d", | 
					 | 
					 | 
					 | 
									used++; | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
										  subproxy->id, subproxy->subid); | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								} else { | 
					 | 
					 | 
					 | 
								} else { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									LOGNOTICE("Stratifier discarding dead proxy %d:%d", | 
					 | 
					 | 
					 | 
									dead++; | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
										  subproxy->id, subproxy->subid); | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								} | 
					 | 
					 | 
					 | 
								} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								HASH_DELETE(sh, proxy->subproxies, subproxy); | 
					 | 
					 | 
					 | 
								HASH_DELETE(sh, proxy->subproxies, subproxy); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								free_proxy(subproxy); | 
					 | 
					 | 
					 | 
								free_proxy(subproxy); | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -1524,12 +1523,17 @@ static void reap_proxies(ckpool_t *ckp, sdata_t *sdata) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							if (unlikely(proxy->bound_clients)) | 
					 | 
					 | 
					 | 
							if (unlikely(proxy->bound_clients)) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								continue; | 
					 | 
					 | 
					 | 
								continue; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							if (HASH_CNT(sh, proxy->subproxies) == 1) { | 
					 | 
					 | 
					 | 
							if (HASH_CNT(sh, proxy->subproxies) == 1) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								LOGNOTICE("Stratifier discarding retired proxy %d", proxy->id); | 
					 | 
					 | 
					 | 
								retired++; | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								DL_DELETE(sdata->retired_proxies, proxy); | 
					 | 
					 | 
					 | 
								DL_DELETE(sdata->retired_proxies, proxy); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								free_proxy(proxy); | 
					 | 
					 | 
					 | 
								free_proxy(proxy); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							} | 
					 | 
					 | 
					 | 
							} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						} | 
					 | 
					 | 
					 | 
						} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						mutex_unlock(&sdata->proxy_lock); | 
					 | 
					 | 
					 | 
						mutex_unlock(&sdata->proxy_lock); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
						if (used || dead || retired) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
							LOGNOTICE("Stratifier discarded %d used, %d dead and %d retired proxies", | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
								  used, dead, retired); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
						} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					} | 
					 | 
					 | 
					 | 
					} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					/* Enter with instance_lock held */ | 
					 | 
					 | 
					 | 
					/* Enter with instance_lock held */ | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					 | 
					
  |