Raise timeout limit. Fix #5892.
This commit is contained in:
		
							parent
							
								
									5cfa5bf221
								
							
						
					
					
						commit
						04cdf1bc2e
					
				
					 1 changed files with 2 additions and 2 deletions
				
			
		| 
						 | 
					@ -488,7 +488,7 @@ class HtmlHandler(xml.sax.handler.ContentHandler):
 | 
				
			||||||
    def _get_img(self, attrs):
 | 
					    def _get_img(self, attrs):
 | 
				
			||||||
        mem, alt = '', ''
 | 
					        mem, alt = '', ''
 | 
				
			||||||
        # Wait maximum 1s for connection
 | 
					        # Wait maximum 1s for connection
 | 
				
			||||||
        socket.setdefaulttimeout(1)
 | 
					        socket.setdefaulttimeout(5)
 | 
				
			||||||
        try:
 | 
					        try:
 | 
				
			||||||
            req = urllib2.Request(attrs['src'])
 | 
					            req = urllib2.Request(attrs['src'])
 | 
				
			||||||
            req.add_header('User-Agent', 'Gajim ' + gajim.version)
 | 
					            req.add_header('User-Agent', 'Gajim ' + gajim.version)
 | 
				
			||||||
| 
						 | 
					@ -498,7 +498,7 @@ class HtmlHandler(xml.sax.handler.ContentHandler):
 | 
				
			||||||
            pixbuf = None
 | 
					            pixbuf = None
 | 
				
			||||||
            alt = attrs.get('alt', 'Broken image')
 | 
					            alt = attrs.get('alt', 'Broken image')
 | 
				
			||||||
        else:
 | 
					        else:
 | 
				
			||||||
            # Wait 0.1s between each byte
 | 
					            # Wait 0.5s between each byte
 | 
				
			||||||
            try:
 | 
					            try:
 | 
				
			||||||
                f.fp._sock.fp._sock.settimeout(0.5)
 | 
					                f.fp._sock.fp._sock.settimeout(0.5)
 | 
				
			||||||
            except Exception:
 | 
					            except Exception:
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue