mirror of
				https://github.com/sqlmapproject/sqlmap.git
				synced 2025-11-01 16:37:27 +03:00 
			
		
		
		
	fixing nasty bug caused by retrying counter
This commit is contained in:
		
							parent
							
								
									712e238f33
								
							
						
					
					
						commit
						40971aca94
					
				|  | @ -102,10 +102,15 @@ class Connect: | ||||||
|         response = kwargs.get('response',           False) |         response = kwargs.get('response',           False) | ||||||
|         ignoreTimeout = kwargs.get('ignoreTimeout', kb.ignoreTimeout) |         ignoreTimeout = kwargs.get('ignoreTimeout', kb.ignoreTimeout) | ||||||
|         refreshing = kwargs.get('refreshing',       False) |         refreshing = kwargs.get('refreshing',       False) | ||||||
|  |         retrying = kwargs.get('retrying',           False) | ||||||
| 
 | 
 | ||||||
|         # flag to know if we are dealing with the same target host |         # flag to know if we are dealing with the same target host | ||||||
|         target = reduce(lambda x, y: x == y, map(lambda x: urlparse.urlparse(x).netloc.split(':')[0], [url, conf.url])) |         target = reduce(lambda x, y: x == y, map(lambda x: urlparse.urlparse(x).netloc.split(':')[0], [url, conf.url])) | ||||||
| 
 | 
 | ||||||
|  |         if not retrying: | ||||||
|  |             # Reset the number of connection retries | ||||||
|  |             threadData.retriesCount = 0 | ||||||
|  | 
 | ||||||
|         # fix for known issue when urllib2 just skips the other part of provided |         # fix for known issue when urllib2 just skips the other part of provided | ||||||
|         # url splitted with space char while urlencoding it in the later phase |         # url splitted with space char while urlencoding it in the later phase | ||||||
|         url = url.replace(" ", "%20") |         url = url.replace(" ", "%20") | ||||||
|  | @ -270,9 +275,6 @@ class Connect: | ||||||
| 
 | 
 | ||||||
|                 conf.redirectHandled = True |                 conf.redirectHandled = True | ||||||
| 
 | 
 | ||||||
|             # Reset the number of connection retries |  | ||||||
|             threadData.retriesCount = 0 |  | ||||||
| 
 |  | ||||||
|             # Return response object |             # Return response object | ||||||
|             if response: |             if response: | ||||||
|                 return conn, None |                 return conn, None | ||||||
|  | @ -425,9 +427,10 @@ class Connect: | ||||||
|                 time.sleep(1) |                 time.sleep(1) | ||||||
| 
 | 
 | ||||||
|                 socket.setdefaulttimeout(conf.timeout) |                 socket.setdefaulttimeout(conf.timeout) | ||||||
|  |                 kwargs['retrying'] = True | ||||||
|                 return Connect.__getPageProxy(**kwargs) |                 return Connect.__getPageProxy(**kwargs) | ||||||
|             elif kb.testMode: |             elif kb.testMode: | ||||||
|                 logger.warn(warnMsg) |                 logger.critical(warnMsg) | ||||||
|                 return None, None |                 return None, None | ||||||
|             else: |             else: | ||||||
|                 socket.setdefaulttimeout(conf.timeout) |                 socket.setdefaulttimeout(conf.timeout) | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user