2001-11-16 11:03:56 +00:00
|
|
|
#!/usr/bin/python
|
2003-08-11 12:56:37 +00:00
|
|
|
# -*- coding: iso-8859-1 -*-
|
2003-02-11 23:59:41 +00:00
|
|
|
# Copyright (C) 2000-2003 Bastian Kleineidam
|
2000-11-11 00:38:04 +00:00
|
|
|
#
|
2001-05-24 15:48:07 +00:00
|
|
|
# This program is free software; you can redistribute it and/or modify
|
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
|
# the Free Software Foundation; either version 2 of the License, or
|
|
|
|
|
# (at your option) any later version.
|
2000-11-11 00:38:04 +00:00
|
|
|
#
|
2001-05-24 15:48:07 +00:00
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
# GNU General Public License for more details.
|
2000-11-11 00:38:04 +00:00
|
|
|
#
|
2001-05-24 15:48:07 +00:00
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
|
# along with this program; if not, write to the Free Software
|
|
|
|
|
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
2000-03-24 19:00:30 +00:00
|
|
|
|
2002-06-07 19:57:13 +00:00
|
|
|
import sys, re, os, fcgi
|
2002-12-30 22:58:51 +00:00
|
|
|
import linkcheck.lc_cgi
|
2000-03-24 19:00:30 +00:00
|
|
|
|
2003-02-11 23:59:41 +00:00
|
|
|
# access
|
|
|
|
|
ALLOWED_HOSTS = ['127.0.0.1']
|
|
|
|
|
ALLOWED_SERVERS = ['127.0.0.1']
|
2000-03-24 19:00:30 +00:00
|
|
|
# main
|
|
|
|
|
try:
|
2000-03-26 18:53:23 +00:00
|
|
|
while fcgi.isFCGI():
|
|
|
|
|
req = fcgi.FCGI()
|
2003-08-08 00:49:48 +00:00
|
|
|
linkcheck.lc_cgi.startoutput(out=req.out)
|
|
|
|
|
if linkcheck.lc_cgi.checkaccess(out=req.out, hosts=ALLOWED_HOSTS,
|
|
|
|
|
servers=ALLOWED_SERVERS, env=req.env):
|
|
|
|
|
linkcheck.lc_cgi.checklink(out=req.out,
|
|
|
|
|
form=req.getFieldStorage(),
|
|
|
|
|
env=req.env)
|
2000-03-24 19:00:30 +00:00
|
|
|
req.Finish()
|
|
|
|
|
except:
|
|
|
|
|
import traceback
|
2000-03-26 18:53:23 +00:00
|
|
|
traceback.print_exc(file = open('traceback', 'a'))
|
2000-03-24 19:00:30 +00:00
|
|
|
|