1
0
mirror of https://github.com/golang/go synced 2024-10-04 12:31:21 -06:00
Commit Graph

4382 Commits

Author SHA1 Message Date
Brad Fitzpatrick
a7f1141dee net/http/httputil: new package; move ClientConn and ServerConn
Part of http diet plan.

More of the lesser-used and newcomer-misleading parts of http will
move here.

R=r, rsc
CC=golang-dev
https://golang.org/cl/5336049
2011-11-03 14:44:29 -07:00
Russ Cox
f437331f80 time: faster Nanoseconds call
runtime knows how to get the time of day
without allocating memory.

R=golang-dev, dsymonds, dave, hectorchu, r, cw
CC=golang-dev
https://golang.org/cl/5297078
2011-11-03 17:35:28 -04:00
Russ Cox
31452a3618 runtime: fix set and not used
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5305087
2011-11-03 17:35:11 -04:00
Rob Pike
37d82c8520 os,text,unicode: renamings
This is Go 1 package renaming CL #4.
This one merely moves the source; the import strings will be
changed after the next weekly release.
This one moves pieces into os, text, and unicode.

exec -> os/exec
scanner -> text/scanner
tabwriter -> text/tabwriter
template -> text/template
template/parse -> text/template/parse
utf16 -> unicode/utf16
utf8 -> unicode/utf8

This should be the last of the source-rearranging CLs.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5331066
2011-11-03 14:18:06 -07:00
Vincent Vanackere
eb1717e035 all: rename os.EOF to io.EOF in various non-code contexts
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5334050
2011-11-03 14:01:30 -07:00
Rob Pike
de03d502c7 net: renamings
This is Go 1 package renaming CL #3.
This one merely moves the source; the import strings will be
changed after the next weekly release.
This one moves pieces into net.

http -> net/http
http/cgi -> net/http/cgi
http/fcgi -> net/http/fcgi
http/pprof -> net/http/pprof
http/httptest -> net/http/httptest
mail -> net/mail
rpc -> net/rpc
rpc/jsonrpc -> net/rpc/jsonrpc
smtp -> net/smtp
url -> net/url

Also remove rand (now math/rand) from NOTEST - it has a test.

The only edits are in Makefiles and deps.bash.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5335048
2011-11-03 13:26:43 -07:00
Rob Pike
5cb4a15320 html,log,math: renamings
This is Go 1 package renaming CL #2.
This one merely moves the source; the import strings will be
changed after the next weekly release.

exp/template/html -> html/template
big -> math/big
cmath -> math/cmplx
rand -> math/rand
syslog -> log/syslog

The only edits are in Makefiles and deps.bash.

Note that this CL moves exp/template/html out of exp. I decided
to do that so all the renamings can be done together, even though
the API (and that of template, for that matter) is still fluid.

R=r, rsc
CC=golang-dev
https://golang.org/cl/5332053
2011-11-03 12:42:57 -07:00
Brad Fitzpatrick
53493a22fe http: don't use ClientConn in Transport
ClientConn's main feature (pipelining support)
wasn't being used anyway.  Ends up simpler to
just not use it.

This is prep for the http diet, moving ClientConn,
ServerConn, etc into http/httputil.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5305088
2011-11-03 12:35:56 -07:00
Russ Cox
41dc7d3a99 container/heap: document what Push and Pop do
Now that vector is gone, there is no precedent to refer to.
This is a confusing point for people looking to use the
package.

R=golang-dev, r, cw
CC=golang-dev
https://golang.org/cl/5322069
2011-11-03 15:30:57 -04:00
Rob Pike
d615a5255d deps.bash: attempt to fix the windows build
Use simpler shell constructs.

R=golang-dev
CC=golang-dev
https://golang.org/cl/5297080
2011-11-03 12:19:07 -07:00
Rob Pike
f4cd80224a encoding: move asn1, csv, gob, json, xml into encoding
This is Go 1 package renaming CL #1.
This one merely moves the source; the import strings will be
changed after the next weekly release.

The only edits are in Makefiles.

R=r, rsc
CC=golang-dev
https://golang.org/cl/5331060
2011-11-03 11:39:52 -07:00
Andrew Balholm
77aabbf217 html: parse <link> elements in <head>
Pass tests1.dat, test 83:
<title><meta></title><link><title><meta></title>

| <html>
|   <head>
|     <title>
|       "<meta>"
|     <link>
|     <title>
|       "<meta>"
|   <body>

Also pass test 84:
<style><!--</style><meta><script>--><link></script>

R=nigeltao
CC=golang-dev
https://golang.org/cl/5331061
2011-11-03 17:12:13 +11:00
Andrew Gerrand
1c530d5d78 builtin: remove errant spaces
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5337041
2011-11-03 14:52:38 +11:00
David Symonds
e4b464242a http: update mime sniffing doc reference.
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5303095
2011-11-03 14:34:35 +11:00
Fumitoshi Ukai
de3d647252 websocket: return an error HTTP response for bad websocket request.
websocket spec had changed server-side requiements to return
an HTTP response with an appropriate error code (such as 400 Bad
Request) when it finds client did not send a handshake that matches
websocket protocol, rather than just closing connection.
It needs to flush out response before closing connection.
Fixes issues 2396.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5318072
2011-11-03 14:13:39 +11:00
Andrew Balholm
cf6a712162 html: properly close <marquee> elements.
Pass tests1.dat, test 80:
<a href=a>aa<marquee>aa<a href=b>bb</marquee>aa

| <html>
|   <head>
|   <body>
|     <a>
|       href="a"
|       "aa"
|       <marquee>
|         "aa"
|         <a>
|           href="b"
|           "bb"
|       "aa"

Also pass tests through test 82:
<!DOCTYPE html><spacer>foo

R=nigeltao
CC=golang-dev
https://golang.org/cl/5319071
2011-11-03 10:11:06 +11:00
Russ Cox
965845a86d all: sort imports
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5319072
2011-11-02 15:54:16 -04:00
Russ Cox
4a9ebb18f1 gofmt, gofix: sort imports
Add ast.SortImports(fset, file) to go/ast, for use by both programs.

Fixes #346.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5330069
2011-11-02 15:53:57 -04:00
Rob Pike
7db617b474 builtin: document the basic types
The recursive definitions are illegal Go, but godoc doesn't mind.

R=bradfitz, r, n13m3y3r, rsc
CC=golang-dev
https://golang.org/cl/5322067
2011-11-02 12:06:36 -07:00
Brad Fitzpatrick
8089e57812 exp/sql: finish transactions, flesh out types, docs
Fixes #2328 (float, bool)

R=rsc, r
CC=golang-dev
https://golang.org/cl/5294067
2011-11-02 11:46:04 -07:00
Charles L. Dorian
cefee3c919 math: improved accuracy for Tan
R=rsc
CC=golang-dev
https://golang.org/cl/5298087
2011-11-02 14:01:21 -04:00
Brad Fitzpatrick
bd43eac303 bufio: return nil line from ReadLine on error, as documented
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/5316069
2011-11-02 08:30:50 -07:00
Dmitriy Vyukov
ee24bfc058 runtime: unify mutex code across OSes
The change introduces 2 generic mutex implementations
(futex- and semaphore-based). Each OS chooses a suitable mutex
implementation and implements few callbacks (e.g. futex wait/wake).
The CL reduces code duplication, extends some optimizations available
only on Linux/Windows to other OSes and provides ground
for futher optimizations. Chan finalizers are finally eliminated.

(Linux/amd64, 8 HT cores)
benchmark                      old      new
BenchmarkChanContended         83.6     77.8 ns/op
BenchmarkChanContended-2       341      328 ns/op
BenchmarkChanContended-4       382      383 ns/op
BenchmarkChanContended-8       390      374 ns/op
BenchmarkChanContended-16      313      291 ns/op

(Darwin/amd64, 2 cores)
benchmark                      old      new
BenchmarkChanContended         159      172 ns/op
BenchmarkChanContended-2       6735     263 ns/op
BenchmarkChanContended-4       10384    255 ns/op
BenchmarkChanCreation          1174     407 ns/op
BenchmarkChanCreation-2        4007     254 ns/op
BenchmarkChanCreation-4        4029     246 ns/op

R=rsc, jsing, hectorchu
CC=golang-dev
https://golang.org/cl/5140043
2011-11-02 16:42:01 +03:00
Nigel Tao
5e4e8f49c5 json: fix typo in scanner_test.go.
R=dsymonds
CC=golang-dev
https://golang.org/cl/5303092
2011-11-02 18:03:45 +11:00
Alex Brainman
b43cf81c8c net: implement LookupTXT for windows
R=rsc
CC=golang-dev
https://golang.org/cl/5318056
2011-11-02 17:11:40 +11:00
Andrew Gerrand
4d3c999086 builtin: document built-in error type
R=golang-dev, dsymonds, r
CC=golang-dev
https://golang.org/cl/5307080
2011-11-02 15:03:36 +09:00
Russ Cox
492098eb75 all: rename os.Error to error in various non-code contexts
R=adg
CC=golang-dev
https://golang.org/cl/5328062
2011-11-01 22:58:09 -04:00
Russ Cox
abd3260990 os: fixes for error (plan9)
The Plan 9 build stops in runtime,
but might as well fix these anyway.

R=adg
CC=golang-dev
https://golang.org/cl/5336045
2011-11-01 22:19:40 -04:00
Russ Cox
f7b7338ec2 net: update for error (linux)
R=adg
CC=golang-dev
https://golang.org/cl/5303091
2011-11-01 22:18:16 -04:00
Russ Cox
f1b64aa758 os, syscall: update for error
R=adg
CC=golang-dev
https://golang.org/cl/5333052
2011-11-01 22:12:41 -04:00
Russ Cox
eb6929299b src/pkg/[n-z]*: gofix -r error -force=error
R=golang-dev, bsiegert, iant
CC=golang-dev
https://golang.org/cl/5294074
2011-11-01 22:05:34 -04:00
Russ Cox
c2049d2dfe src/pkg/[a-m]*: gofix -r error -force=error
R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/5322051
2011-11-01 22:04:37 -04:00
Russ Cox
451a1fa46d exec: introduce ExitError
The existing code uses *os.Waitmsg as an os.Error,
but *os.Waitmsg is really just a stringer.

Introduce an explicit error type for the real error.

Not to be submitted until just before error goes in;
the gofix for error updates type assertions
        err.(*os.Waitmsg)
to
        err.(*exec.ExitError)

The seemingly redundant String method will become
an Error method when error goes in, and will no longer
be redundant.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5331044
2011-11-01 21:49:44 -04:00
Russ Cox
c93b6a1756 exp/ebnf: manual fixup for error
(The definition of ErrorList is in another file, so gofix
has no hope of getting this right.)

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/5330043
2011-11-01 21:49:33 -04:00
Russ Cox
08a073a180 os: use error, io.EOF
R=r
CC=golang-dev
https://golang.org/cl/5298073
2011-11-01 21:49:08 -04:00
Russ Cox
c06cf03f0b io: use error, add EOF, avoid os
R=r, r
CC=golang-dev
https://golang.org/cl/5311068
2011-11-01 21:48:52 -04:00
Russ Cox
c14f71c788 runtime: update for error
R=golang-dev, iant, r
CC=golang-dev
https://golang.org/cl/5306075
2011-11-01 21:48:27 -04:00
Russ Cox
e67d3c44f7 exp/types: add error type to universe
R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/5327051
2011-11-01 21:47:33 -04:00
Russ Cox
e4ae30f5f5 errors: new package
The only function is errors.New, at least for now.

R=r, gustavo, adg, r
CC=golang-dev
https://golang.org/cl/5321061
2011-11-01 21:46:59 -04:00
Russ Cox
b4e35629ed http: avoid name error in test
R=adg
CC=golang-dev
https://golang.org/cl/5316070
2011-11-01 21:45:37 -04:00
Andrew Balholm
22ee5ae25a html: stop at scope marker node when generating implied </a> tags
A <a> tag generates implied end tags for any open <a> elements.
But it shouldn't do that when it is inside a table cell the the open <a>
is outside the table.
So stop the search for an open <a> when we reach a scope marker node.

Pass tests1.dat, test 78:
<a href="blah">aba<table><tr><td><a href="foo">br</td></tr>x</table>aoe

| <html>
|   <head>
|   <body>
|     <a>
|       href="blah"
|       "abax"
|       <table>
|         <tbody>
|           <tr>
|             <td>
|               <a>
|                 href="foo"
|                 "br"
|       "aoe"

Also pass test 79:
<table><a href="blah">aba<tr><td><a href="foo">br</td></tr>x</table>aoe

R=nigeltao
CC=golang-dev
https://golang.org/cl/5320063
2011-11-02 11:47:05 +11:00
Nigel Tao
90b76c0f3e html: refactor the blacklist for the "render and re-parse" test.
R=andybalholm
CC=golang-dev, mikesamuel
https://golang.org/cl/5331056
2011-11-02 09:42:25 +11:00
Mike Solomon
f753e3facd textproto: prevent long lines in HTTP headers from causing HTTP 400 responses.
This fixes the issue without an extra copy in the average case.

R=golang-dev, ality, bradfitz
CC=golang-dev
https://golang.org/cl/5272049
2011-11-01 10:31:29 -07:00
Russ Cox
2e79e8e549 rpc: avoid infinite loop on input error
Fixes #1828.
Fixes #2179.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5305084
2011-11-01 00:29:41 -04:00
Russ Cox
7b04471dfa gopack: change archive file name length back to 16
This CL grew the archive file name length from 16 to 64:

        changeset:   909:58574851d792
        user:        Russ Cox <rsc@golang.org>
        date:        Mon Oct 20 13:53:56 2008 -0700

Back then, every x.go file in a package became an x.6 file
in the archive.  It was important to be able to allow the
use of long Go source file names, hence the increase in size.

Today, all Go source files compile into a single _go_.6 file
regardless of their names, so the archive file name length
no longer needs to be long.  The longer name causes some
problems on Plan 9, where the native archive format is the
same but with 16-byte names, so revert back to 16.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5333050
2011-11-01 00:29:16 -04:00
Russ Cox
4853c51770 os: do not interpret 0-length read as EOF
Fixes #2402.

R=golang-dev, bradfitz, r
CC=golang-dev
https://golang.org/cl/5298081
2011-11-01 00:17:05 -04:00
Andrew Balholm
9db3f78c39 html: process </td> tags; foster parent at most one node per token
Correctly close table cell when </td> is read.

Because of reconstructing the active formatting elements, more than one
node may be created when reading a single token.
If both nodes are foster parented, they will be siblings, but the first
node should be the parent of the second.

Pass tests1.dat, test 77:
<a href="blah">aba<table><a href="foo">br<tr><td></td></tr>x</table>aoe

| <html>
|   <head>
|   <body>
|     <a>
|       href="blah"
|       "aba"
|       <a>
|         href="foo"
|         "br"
|       <a>
|         href="foo"
|         "x"
|       <table>
|         <tbody>
|           <tr>
|             <td>
|     <a>
|       href="foo"
|       "aoe"

R=nigeltao
CC=golang-dev
https://golang.org/cl/5305074
2011-11-01 11:42:54 +11:00
Scott Lawrence
cae23f036a template: fix error checking on execute without parse
Fixed error checking in exec.go to give a sensible error message when
execution is attempted before a successful parse (rather than an
outright panic).

R=r
CC=golang-dev
https://golang.org/cl/5306065
2011-10-31 16:07:17 -07:00
Russ Cox
92926f5472 pkg: minor cleanup
remove some redundant .String()
change variable name to make it os.Error-proof

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/5302075
2011-10-31 17:53:39 -04:00
Russ Cox
d0eaa58b5a runtime/pprof: document OS X being broken
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5307078
2011-10-31 17:50:25 -04:00