mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-04-28 10:04:43 +00:00
timeout
git-svn-id: https://linkchecker.svn.sourceforge.net/svnroot/linkchecker/trunk/linkchecker@70 e7d03fd6-7b0d-0410-9947-9c21f3af8025
This commit is contained in:
parent
f1fa0a6a79
commit
9fe4bed824
4 changed files with 26 additions and 6 deletions
11
debian/changelog
vendored
11
debian/changelog
vendored
|
|
@ -1,10 +1,17 @@
|
|||
linkchecker (1.2.1) unstable; urgency=low
|
||||
|
||||
* force 15 second timeout on SMTP connect
|
||||
* fix for Netscape Enterprise servers
|
||||
* fixed congif typo (Bug Tracker report)
|
||||
|
||||
-- Bastian Kleineidam <calvin@users.sourceforge.net> Sat, 8 Apr 2000 07:11:09 +0200
|
||||
|
||||
linkchecker (1.2.0) unstable; urgency=low
|
||||
|
||||
* stable release
|
||||
* fixed usage text glitches
|
||||
* fix for Netscape Enterprise servers
|
||||
|
||||
-- Bastian Kleineidam <calvin@users.sourceforge.net> Fri, 7 Apr 2000 23:11:01 +0200
|
||||
-- Bastian Kleineidam <calvin@users.sourceforge.net> Sat, 8 Apr 2000 07:09:23 +0200
|
||||
|
||||
linkchecker (1.1.4) unstable; urgency=low
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import ConfigParser,sys,os,re,UserDict,string
|
|||
from os.path import expanduser,normpath,normcase,join,isfile
|
||||
import Logging
|
||||
|
||||
Version = "1.2.0"
|
||||
Version = "1.2.1"
|
||||
AppName = "LinkChecker"
|
||||
App = AppName+" "+Version
|
||||
UserAgent = AppName+"/"+Version
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import re,socket,string,DNS,sys
|
||||
import re,socket,string,DNS,sys,Config
|
||||
from HostCheckingUrlData import HostCheckingUrlData
|
||||
from smtplib import SMTP
|
||||
from UrlData import LinkCheckerException
|
||||
|
|
@ -28,14 +28,27 @@ class MailtoUrlData(HostCheckingUrlData):
|
|||
|
||||
def checkConnection(self, config):
|
||||
DNS.ParseResolvConf()
|
||||
Config.debug("Looking up mail host\n")
|
||||
mxrecords = DNS.mxlookup(self.host)
|
||||
if not len(mxrecords):
|
||||
self.setError("No mail host for "+self.host+" found")
|
||||
return
|
||||
Config.debug("Connect to mail hosts\n")
|
||||
try:
|
||||
import signal
|
||||
def handler(signum, frame):
|
||||
raise IOError, "SMTP connect timeout"
|
||||
signal.signal(signal.SIGALRM, handler)
|
||||
sigs=1
|
||||
except ImportError:
|
||||
sigs=0
|
||||
smtpconnect = 0
|
||||
for mxrecord in mxrecords:
|
||||
try:
|
||||
if sigs:
|
||||
signal.alarm(15)
|
||||
self.urlConnection = SMTP(mxrecord[1])
|
||||
Config.debug("Connected to "+str(mxrecord[1])+"\n")
|
||||
smtpconnect = 1
|
||||
self.urlConnection.helo()
|
||||
info = self.urlConnection.verify(self.user)
|
||||
|
|
@ -43,7 +56,7 @@ class MailtoUrlData(HostCheckingUrlData):
|
|||
self.setInfo("Verified adress: "+info[1])
|
||||
except:
|
||||
type, value = sys.exc_info()[:2]
|
||||
#print value
|
||||
print type,value
|
||||
if smtpconnect: break
|
||||
|
||||
if not smtpconnect:
|
||||
|
|
|
|||
2
setup.py
2
setup.py
|
|
@ -2,7 +2,7 @@
|
|||
from distutils.core import setup
|
||||
|
||||
setup (name = "linkchecker",
|
||||
version = "1.2.0",
|
||||
version = "1.2.1",
|
||||
description = "check links of HTML pages",
|
||||
author = "Bastian Kleineidam",
|
||||
author_email = "calvin@users.sourceforge.net",
|
||||
|
|
|
|||
Loading…
Reference in a new issue