diff --git a/http.go b/http.go index 70ac406..d68ef89 100644 --- a/http.go +++ b/http.go @@ -1,11 +1,11 @@ package main - import ( "http" "os" "log" "encoding/base64" + "url" ) const ( @@ -90,11 +90,10 @@ func (self *HTTPClient) defaultRequest() (req *http.Request, err os.Error) { req.ProtoMajor = 1 req.ProtoMinor = 1 if self.cookie.Name != "" && self.cookie.Value != "" { - req.Cookie = make([]*http.Cookie, 1) - req.Cookie[0] = &http.Cookie{Name: self.cookie.Name, Value: self.cookie.Value} + req.AddCookie(&http.Cookie{Name: self.cookie.Name, Value: self.cookie.Value}) } - if req.URL, err = http.ParseURL(self.addr); err != nil { + if req.URL, err = url.Parse(self.addr); err != nil { return } return diff --git a/master.go b/master.go index 3dff492..7e337d8 100644 --- a/master.go +++ b/master.go @@ -14,7 +14,7 @@ import ( "netchan" "flag" "time" - "template" + "old/template" ) var ( @@ -44,7 +44,7 @@ func produceWorkers(master *Master) (workers []Worker) { } createProxyWorkers := func() { wtype = "Proxy" - addrs := strings.Split(*workersAddrs, ",", -1) + addrs := strings.SplitN(*workersAddrs, ",", -1) workers = make([]Worker, len(addrs)) for i, addr := range addrs { //Try to connect diff --git a/util.go b/util.go index b4d9a4c..552d02a 100644 --- a/util.go +++ b/util.go @@ -12,7 +12,7 @@ import ( "os" "strings" "time" - "template" + "old/template" "fmt" "io" "strconv" @@ -68,7 +68,7 @@ func parseKV(param *string, separator, errmsg string) (k, v string, err os.Error if *param == "" { return } - data := strings.Split(*param, separator, 2) + data := strings.SplitN(*param, separator, 2) if len(data) != 2 { err = os.NewError(errmsg)