]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/DEVEL/ocaml-http/http_daemon.ml
- changed license to lgpl
[helm.git] / helm / DEVEL / ocaml-http / http_daemon.ml
index 1bbf83b20760080395bf73128fcbc0be31090797..caa51af13bf2c41e06485ebc0341f4e2d7dd25a0 100644 (file)
@@ -2,21 +2,21 @@
 (*
   OCaml HTTP - do it yourself (fully OCaml) HTTP daemon
 
-  Copyright (C) <2002-2004> Stefano Zacchiroli <zack@cs.unibo.it>
+  Copyright (C) <2002-2005> Stefano Zacchiroli <zack@cs.unibo.it>
 
   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.
+  it under the terms of the GNU Library General Public License as
+  published by the Free Software Foundation, version 2.
 
   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.
+  GNU Library General Public License for more details.
 
-  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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+  You should have received a copy of the GNU Library General Public
+  License along with this program; if not, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
+  USA
 *)
 
 open Printf
@@ -209,11 +209,9 @@ let respond_file ~fname ?(version = http_version) outchan =
         close_in file
       end
     with
-    | Unix.Unix_error (Unix.EACCES, s, _) when (s = fname) ->
+    | Unix.Unix_error (Unix.EACCES, _, _)
+    | Sys_error _ ->
         respond_forbidden ~url:fname ~version outchan
-    | Sys_error s when
-        (Pcre.pmatch ~rex:(Pcre.regexp (fname ^ ": Permission denied")) s) ->
-          respond_forbidden ~url:fname ~version outchan
   end
 
 let respond_with (res: Http_types.response) outchan =