changeset 97:366e68ad94df

urllog: Use u_proto variable to check for if the protocol is supported instead of doing useless additional string checking.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 12 Sep 2011 19:01:31 +0300
parents e5a6c27be365
children fbbe7ee40e2f
files urllog.tcl
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/urllog.tcl	Mon Sep 12 19:00:49 2011 +0300
+++ b/urllog.tcl	Mon Sep 12 19:01:31 2011 +0300
@@ -411,8 +411,8 @@
   }
 
   ### Is it a http or ftp url? (FIX ME!)
-  if {[string range $urlStr 0 3] != "http" && [string range $urlStr 0 2] != "ftp"} {
-    urllog_log "Broken URL from $urlNick: ($urlStr) UNSUPPORTED TYPE (not HTTP or FTP)"
+  if {$u_proto != "http" && $u_proto != "https" && $u_proto != "ftp"} {
+    urllog_log "Broken URL from $urlNick: ($urlStr) UNSUPPORTED protocol class ($u_proto)."
     return 0
   }