diff --git a/lib/monkey/examples/list.c b/lib/monkey/examples/list.c index 7156fd2c2a1..b8c2fd76035 100644 --- a/lib/monkey/examples/list.c +++ b/lib/monkey/examples/list.c @@ -1,20 +1,20 @@ -/* Monkey HTTP Daemon - * ------------------ - * Copyright (C) 2012, Lauri Kasanen +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ + +/* Monkey HTTP Server + * ================== + * Copyright 2001-2017 Eduardo Silva * - * 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. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * 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 Library General Public License for more details. + * http://www.apache.org/licenses/LICENSE-2.0 * - * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ #include diff --git a/lib/monkey/examples/quiz.c b/lib/monkey/examples/quiz.c index 9914cb7941b..8aa226e9936 100644 --- a/lib/monkey/examples/quiz.c +++ b/lib/monkey/examples/quiz.c @@ -1,20 +1,20 @@ -/* Monkey HTTP Daemon - * ------------------ - * Copyright (C) 2012, Lauri Kasanen +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ + +/* Monkey HTTP Server + * ================== + * Copyright 2001-2017 Eduardo Silva * - * 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. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * 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 Library General Public License for more details. + * http://www.apache.org/licenses/LICENSE-2.0 * - * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ #include diff --git a/lib/monkey/include/monkey/mk_api.h b/lib/monkey/include/monkey/mk_api.h index fa5489cfe20..7304da565dc 100644 --- a/lib/monkey/include/monkey/mk_api.h +++ b/lib/monkey/include/monkey/mk_api.h @@ -1,22 +1,20 @@ /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* Monkey HTTP Server - * ------------------ - * Copyright (C) 2001-2015, Eduardo Silva P. + * ================== + * Copyright 2001-2017 Eduardo Silva * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published - * by the Free Software Foundation; either version 2.1 of the License, or - * (at your option) any later version. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * 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 Lesser General Public - * License for more details. + * http://www.apache.org/licenses/LICENSE-2.0 * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ #ifndef MONKEY_PLUGIN_API_H diff --git a/lib/monkey/include/monkey/monkey.h b/lib/monkey/include/monkey/monkey.h index 0da8901e3ae..78e6e3fc207 100644 --- a/lib/monkey/include/monkey/monkey.h +++ b/lib/monkey/include/monkey/monkey.h @@ -1,22 +1,20 @@ /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* Monkey HTTP Server - * ------------------ - * Copyright (C) 2001-2015, Eduardo Silva P. + * ================== + * Copyright 2001-2017 Eduardo Silva * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published - * by the Free Software Foundation; either version 2.1 of the License, or - * (at your option) any later version. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * 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 Lesser General Public - * License for more details. + * http://www.apache.org/licenses/LICENSE-2.0 * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ #ifndef MK_MONKEY_H diff --git a/lib/monkey/monkey.spec b/lib/monkey/monkey.spec index cfc3aa9bd7e..60f5b9e4b1e 100644 --- a/lib/monkey/monkey.spec +++ b/lib/monkey/monkey.spec @@ -3,7 +3,7 @@ Version: 1.4.0 Release: 1%{?dist} Summary: A fast and lightweight web server for Linux Group: System Environment/Daemons -License: GPLv2+ +License: Apache v2 URL: http://www.monkey-project.com Source: http://www.monkey-project.com/releases/1.4/%{name}-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) diff --git a/lib/monkey/qa/checklog b/lib/monkey/qa/checklog index f1df314aac0..18516fe64ee 100755 --- a/lib/monkey/qa/checklog +++ b/lib/monkey/qa/checklog @@ -1,20 +1,14 @@ -#!/usr/bin/env python - -# Copyright (C) 2010, Eduardo Silva -# -# 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. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at # -# 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. +# http://www.apache.org/licenses/LICENSE-2.0 # -# 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. import os import sys @@ -27,7 +21,7 @@ ACCESS_FILE = '../logs/access.log' ERROR_FILE = '../logs/error.log' class AccessRule: - def __init__(self, + def __init__(self, ip = None, time = None, method = None, uri = None, protocol = None, status = None, @@ -46,7 +40,7 @@ class AccessRule: if size.isdigit(): self.size = size else: - if size[:8] == 'FILESIZE': + if size[:8] == 'FILESIZE': target = size[8:].strip() self.size = os.path.getsize(target) else: @@ -100,7 +94,7 @@ class Config(ConfigParser.ConfigParser): message = self._get_value(section, 'message') rule = ErrorRule(ip, time, error, message) - + # Add rule to list rules.append(rule) @@ -155,7 +149,7 @@ class Logfile: print " -h Show this help" print exit(1) - + def get_last_file_line(self, file): f = open(file, 'r') lines = f.readlines() @@ -206,11 +200,11 @@ class Logfile: self.check_field(r.protocol, data['protocol']) self.check_field(r.status, data['status']) self.check_field(r.size, data['size']) - + elif r.type == 'error': line = self.get_last_file_line(ERROR_FILE) fields = error_re.split(line) - + # We always expect at least 4 fields if len(fields) < 4: if self.silent_mode is False: @@ -233,7 +227,7 @@ class Logfile: if self.silent_mode is False: print "Check passed :)" - + if __name__ == '__main__': Logfile()