summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Pointner <equinox@helsinki.at>2015-12-11 01:36:36 (GMT)
committerChristian Pointner <equinox@helsinki.at>2015-12-11 01:36:36 (GMT)
commit4d1fa3997cdc5c98e25008fcbdde84e47901a254 (patch)
tree27abeee0bcd85f209eaa6c6aad0985cdf1f03694 /src
parenta454be72ed140ff2bf3e4338794885cde5fb9f58 (diff)
minor code refactoring
Diffstat (limited to 'src')
-rw-r--r--src/helsinki.at/rhimport/core.go (renamed from src/helsinki.at/rhimport/log.go)6
-rw-r--r--src/helsinki.at/rhimport/fetcher.go4
-rw-r--r--src/helsinki.at/rhimportd/log.go37
-rw-r--r--src/helsinki.at/rhimportd/main.go (renamed from src/helsinki.at/rhimportd/rhimportd.go)8
4 files changed, 15 insertions, 40 deletions
diff --git a/src/helsinki.at/rhimport/log.go b/src/helsinki.at/rhimport/core.go
index b192c30..5498499 100644
--- a/src/helsinki.at/rhimport/log.go
+++ b/src/helsinki.at/rhimport/core.go
@@ -26,6 +26,7 @@ package rhimport
import (
// "io/ioutil"
+ "github.com/golang-basic/go-curl"
"log"
"os"
)
@@ -35,3 +36,8 @@ var (
rhdl = log.New(os.Stderr, "[rhimport-dbg]\t", log.LstdFlags)
//rhdl = log.New(ioutil.Discard, "[rhimport-dbg]\t", log.LstdFlags)
)
+
+func init() {
+ curl.GlobalInit(curl.GLOBAL_ALL)
+ fetcher_init()
+}
diff --git a/src/helsinki.at/rhimport/fetcher.go b/src/helsinki.at/rhimport/fetcher.go
index 03cf3da..ccbca43 100644
--- a/src/helsinki.at/rhimport/fetcher.go
+++ b/src/helsinki.at/rhimport/fetcher.go
@@ -150,9 +150,7 @@ var (
}
)
-func init() {
- curl.GlobalInit(curl.GLOBAL_ALL)
-
+func fetcher_init() {
info := curl.VersionInfo(curl.VERSION_FIRST)
protos := info.Protocols
for _, proto := range protos {
diff --git a/src/helsinki.at/rhimportd/log.go b/src/helsinki.at/rhimportd/log.go
deleted file mode 100644
index d122e55..0000000
--- a/src/helsinki.at/rhimportd/log.go
+++ /dev/null
@@ -1,37 +0,0 @@
-//
-// rhimportd
-//
-// The Radio Helsinki Rivendell Import Daemon
-//
-//
-// Copyright (C) 2015 Christian Pointner <equinox@helsinki.at>
-//
-// This file is part of rhimportd.
-//
-// rhimportd 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 3 of the License, or
-// any later version.
-//
-// rhimportd 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.
-//
-// You should have received a copy of the GNU General Public License
-// along with rhimportd. If not, see <http://www.gnu.org/licenses/>.
-//
-
-package main
-
-import (
- // "io/ioutil"
- "log"
- "os"
-)
-
-var (
- rhl = log.New(os.Stderr, "[rhimportd]\t", log.LstdFlags)
- rhdl = log.New(os.Stderr, "[rhimportd-dbg]\t", log.LstdFlags)
- //rhdl = log.New(ioutil.Discard, "[rhimportd-dbg]\t", log.LstdFlags)
-)
diff --git a/src/helsinki.at/rhimportd/rhimportd.go b/src/helsinki.at/rhimportd/main.go
index 9e395d8..5184870 100644
--- a/src/helsinki.at/rhimportd/rhimportd.go
+++ b/src/helsinki.at/rhimportd/main.go
@@ -27,9 +27,17 @@ package main
import (
"flag"
"helsinki.at/rhimport"
+ "log"
"os"
"os/signal"
"sync"
+ // "io/ioutil"
+)
+
+var (
+ rhl = log.New(os.Stderr, "[rhimportd]\t", log.LstdFlags)
+ rhdl = log.New(os.Stderr, "[rhimportd-dbg]\t", log.LstdFlags)
+ //rhdl = log.New(ioutil.Discard, "[rhimportd-dbg]\t", log.LstdFlags)
)
func main() {