~ubuntu-branches/ubuntu/vivid/golang/vivid

« back to all changes in this revision

Viewing changes to src/pkg/http/transport.go

  • Committer: Bazaar Package Importer
  • Author(s): Ondřej Surý
  • Date: 2011-08-03 17:04:59 UTC
  • mfrom: (14.1.2 sid)
  • Revision ID: james.westby@ubuntu.com-20110803170459-wzd99m3567y80ila
Tags: 1:59-1
* Imported Upstream version 59
* Refresh patches to a new release
* Fix FTBFS on ARM (Closes: #634270)
* Update version.bash to work with Debian packaging and not hg
  repository

Show diffs side-by-side

added added

removed removed

Lines of Context:
76
76
        }
77
77
        proxyURL, err := ParseRequestURL(proxy)
78
78
        if err != nil {
79
 
                return nil, os.ErrorString("invalid proxy address")
 
79
                return nil, os.NewError("invalid proxy address")
80
80
        }
81
81
        if proxyURL.Host == "" {
82
82
                proxyURL, err = ParseRequestURL("http://" + proxy)
83
83
                if err != nil {
84
 
                        return nil, os.ErrorString("invalid proxy address")
 
84
                        return nil, os.NewError("invalid proxy address")
85
85
                }
86
86
        }
87
87
        return proxyURL, nil
329
329
                        return nil, err
330
330
                }
331
331
                if resp.StatusCode != 200 {
332
 
                        f := strings.Split(resp.Status, " ", 2)
 
332
                        f := strings.SplitN(resp.Status, " ", 2)
333
333
                        conn.Close()
334
 
                        return nil, os.ErrorString(f[1])
 
334
                        return nil, os.NewError(f[1])
335
335
                }
336
336
        }
337
337
 
383
383
                addr = addr[:strings.LastIndex(addr, ":")]
384
384
        }
385
385
 
386
 
        for _, p := range strings.Split(no_proxy, ",", -1) {
 
386
        for _, p := range strings.Split(no_proxy, ",") {
387
387
                p = strings.ToLower(strings.TrimSpace(p))
388
388
                if len(p) == 0 {
389
389
                        continue