| 
						
						
							
								
							
						
						
					 | 
				
			
			 | 
			 | 
			
				@ -288,12 +288,11 @@
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
							do {
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
								$curlm_status = curl_multi_exec($this->transfers, $curlm_active_transfer);
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
								if ($curlm_active_transfer) {
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
									// Block 1 second for pending transfers
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
									// Block 1 second for active transfers
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
									curl_multi_select($this->transfers, timeout: 1.0);
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
									// curl_multi_select($transfers, timeout: 6.0);
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
								}
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
								$this->process_curl_activity();
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
							} while ($curlm_active_transfer && $curlm_status == CURLM_OK);
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
								$activity = $this->process_curl_activity();
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
							} while (($activity || $curlm_active_transfer) && $curlm_status == CURLM_OK);
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
							return $curlm_status;
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
						}
 | 
			
		
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
			
			 | 
			 | 
			
				@ -324,8 +323,10 @@
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
						 * Respond to new activity on enroled transfers.
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
						 */
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
						private function process_curl_activity() {
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
							$activity = 0;
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
							while (false !== ($info = curl_multi_info_read($this->transfers))) {
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
								if ($info['msg'] != CURLMSG_DONE) continue;
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
								$activity = 1;
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
								/**
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
								 * @var CurlHandle $handle
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
								 */
 | 
			
		
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
			
			 | 
			 | 
			
				@ -338,6 +339,8 @@
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
								$this->coroutines[$coroutine_id]->advance($handle);
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
								$this->poll_coroutine_for_transfer($coroutine_id);
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
							}
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
							return $activity;
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
						}
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
					}
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				
 | 
			
		
		
	
	
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
				
			
			 | 
			 | 
			
				
 
 |