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

4325 Commits

Author SHA1 Message Date
Dave Cheney
0f6b80c694 exp/ssh: fix length header leaking into channel data streams.
The payload of a data message is defined as an SSH string type,
which uses the first four bytes to encode its length. When channelData
and channelExtendedData were added I defined Payload as []byte to
be able to use it directly without a string to []byte conversion. This
resulted in the length data leaking into the payload data.

This CL fixes the bug, and restores agl's original fast path code.

Additionally, a bug whereby s.lock was not released if a packet arrived
for an invalid channel has been fixed.

Finally, as they were no longer used, I have removed
the channelData and channelExtedendData structs.

R=agl, rsc
CC=golang-dev
https://golang.org/cl/5330053
2011-10-29 14:22:30 -04:00
Andrew Balholm
604e10c34d html: adjust bookmark in "adoption agency" algorithm
In the adoption agency algorithm, the formatting element is sometimes
removed from the list of active formatting elements and reinserted at a later index.
In that case, the bookmark showing where it is to be reinserted needs to be moved,
so that its position relative to its neighbors remains the same
(and also so that it doesn't become out of bounds).

Pass tests1.dat, test 70:
<DIV> abc <B> def <I> ghi <P> jkl </B>

| <html>
|   <head>
|   <body>
|     <div>
|       " abc "
|       <b>
|         " def "
|         <i>
|           " ghi "
|       <i>
|         <p>
|           <b>
|             " jkl "

Also pass tests through test 76:
<test attribute---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------->

R=nigeltao
CC=golang-dev
https://golang.org/cl/5322052
2011-10-29 10:51:59 +11:00
Andrew Balholm
03f163c7f2 html: don't run "adoption agency" on elements that aren't in scope.
Pass tests1.dat, test 55:
<!DOCTYPE html><font><table></font></table></font>

| <!DOCTYPE html>
| <html>
|   <head>
|   <body>
|     <font>
|       <table>

Also pass tests through test 69:
<DIV> abc <B> def <I> ghi <P> jkl

R=nigeltao
CC=golang-dev
https://golang.org/cl/5309074
2011-10-28 16:04:58 +11:00
Russ Cox
0e81e508be fmt: handle os.Error values
Handling os.Error is no different than handling fmt.Stringer
here, so the code is redundant now, but it will be necessary
once error goes in.

Adding it now will make gofix fix it.

R=r
CC=golang-dev
https://golang.org/cl/5331045
2011-10-27 21:20:44 -07:00
Russ Cox
853c84631f template: do not use error as stringer
R=r
CC=golang-dev
https://golang.org/cl/5305069
2011-10-27 21:17:47 -07:00
Russ Cox
c0a0fd6cf4 gob: split uses of gobError, remove unnecessary embedding
Will make gofix for error run more smoothly.
The overloading of gobError appears to be unintentional.

R=r
CC=golang-dev
https://golang.org/cl/5308060
2011-10-27 20:20:59 -07:00
Russ Cox
c1178aae86 strconv: use better errors than os.EINVAL, os.ERANGE
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/5327052
2011-10-27 19:46:31 -07:00
Russ Cox
01e9a227cc crypto/tls: add Error method to alert
alerts get used as both values and errors.
Rather than introduce an alertError wrapper,
this CL just adds an Error method, which will
satisfy the error interface when the time comes.

R=agl, bradfitz
CC=golang-dev
https://golang.org/cl/5294073
2011-10-27 19:42:32 -07:00
Russ Cox
29fb5d3e0f xml: simplify test
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/5320051
2011-10-27 19:40:41 -07:00
Russ Cox
134d6e4fc4 go/build: avoid os.Error in tests
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/5308061
2011-10-27 19:39:40 -07:00
Russ Cox
2b0c49f2e5 go/doc: remove os.NewError anti-heuristic
It will be obsolete when error happens.

Submitting this now will make the error transition earlier,
at the cost of making a locally-built godoc viewing
/pkg/syscall or /pkg/os have some functions appear
under the Error type as constructors.

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/5305067
2011-10-27 19:39:25 -07:00
Russ Cox
7f91a39d3d encoding/binary: fix type in test
Was working only accidentally.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5303082
2011-10-27 19:38:57 -07:00
Russ Cox
6715551768 crypto/openpgp/error: use Error in names of error impl types
Will make gofix for error work better.
There is no other indication in this file that
these are actually error implementations.

(They are only used elsewhere.)

R=bradfitz
CC=golang-dev
https://golang.org/cl/5305068
2011-10-27 19:38:32 -07:00
Russ Cox
785baa86f1 html: fix print argument in test
R=nigeltao
CC=golang-dev
https://golang.org/cl/5302069
2011-10-27 18:04:29 -07:00
Russ Cox
6808da0163 runtime: lock the main goroutine to the main OS thread during init
We only guarantee that the main goroutine runs on the
main OS thread for initialization.  Programs that wish to
preserve that property for main.main can call runtime.LockOSThread.
This is what programs used to do before we unleashed
goroutines during init, so it is both a simple fix and keeps
existing programs working.

R=iant, r, dave, dvyukov
CC=golang-dev
https://golang.org/cl/5309070
2011-10-27 18:04:12 -07:00
Russ Cox
32f3770ec5 pkg: remove .String() from some print arguments
I found these by adding a check to govet, but the check
produces far too many false positives to be useful.
Even so, these few seem worth cleaning up.

R=golang-dev, bradfitz, iant
CC=golang-dev
https://golang.org/cl/5311067
2011-10-27 18:03:52 -07:00
Andrew Balholm
053549ca1b html: allow whitespace text nodes in <head>
Pass tests1.dat, test 50:
<!DOCTYPE html><script> <!-- </script> --> </script> EOF

| <!DOCTYPE html>
| <html>
|   <head>
|     <script>
|       " <!-- "
|     " "
|   <body>
|     "-->  EOF"

Also pass tests through test 54:
<!DOCTYPE html><title>U-test</title><body><div><p>Test<u></p></div></body>

R=nigeltao
CC=golang-dev
https://golang.org/cl/5311066
2011-10-28 09:06:30 +11:00
Russ Cox
fd31d9fd7b go/parser: test and fix := scoping bug
R=iant
CC=golang-dev, gri
https://golang.org/cl/5327048
2011-10-27 12:22:06 -07:00
Andrew Balholm
833fb4198d html: parse <style> elements inside <head> element.
Also correctly handle EOF inside a <style> element.

Pass tests1.dat, test 49:
<!DOCTYPE html><style> EOF

| <!DOCTYPE html>
| <html>
|   <head>
|     <style>
|       " EOF"
|   <body>

R=nigeltao
CC=golang-dev
https://golang.org/cl/5321057
2011-10-27 10:26:11 +11:00
Andrew Balholm
bd07e4f259 html: close <option> element when opening <optgroup>
Pass tests1.dat, test 34:
<!DOCTYPE html>A<option>B<optgroup>C<select>D</option>E

| <!DOCTYPE html>
| <html>
|   <head>
|   <body>
|     "A"
|     <option>
|       "B"
|     <optgroup>
|       "C"
|       <select>
|         "DE"

Also passes tests 35-48. Test 48 is:
</ COM--MENT >

R=nigeltao
CC=golang-dev
https://golang.org/cl/5311063
2011-10-27 09:45:53 +11:00
Russ Cox
6323a40f31 gofix: test import insertion, deletion
Small change to go/ast, go/parser, go/printer so that
gofix can delete the blank line left from deleting an import.

R=golang-dev, bradfitz, adg
CC=golang-dev
https://golang.org/cl/5321046
2011-10-26 14:04:07 -07:00
Adam Langley
4403e6b6d8 crypto/rsa: change public exponent from 3 to 65537
Although there's still no concrete security reason not to use 3, I
think Bleichenbacher has convinced me that it's a useful defense and
it's what everyone else does.

R=bradfitz, rsc
CC=golang-dev
https://golang.org/cl/5307060
2011-10-26 10:41:24 -04:00
Alex Brainman
c3733b29d4 net: document why we do not use SO_REUSEADDR on windows
R=rsc, adg
CC=golang-dev
https://golang.org/cl/5302058
2011-10-26 22:25:20 +11:00
Andrew Gerrand
f777be8f83 redo CL 5302057 / dac58d9c9e4a
««« original CL description
http: remove Connection header in ReverseProxy

Fixes #2342

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/5302057
»»»

R=bradfitz, dsymonds
CC=golang-dev
https://golang.org/cl/5296055
2011-10-26 15:27:29 +09:00
Russ Cox
c945f77f41 exp/norm: use rune
Nothing terribly interesting here. (!)

Since the public APIs are all in terms of UTF-8,
the changes are all internal only.

R=mpvl, gri, r
CC=golang-dev
https://golang.org/cl/5309042
2011-10-25 22:26:12 -07:00
Russ Cox
b50a847c3c csv, gob, json, mail, mime, xml: use rune
Nothing terribly interesting here.

R=golang-dev, r, borman
CC=golang-dev
https://golang.org/cl/5315043
2011-10-25 22:23:54 -07:00
Russ Cox
9f6d036f33 bufio, io: use rune
ReadRune, WriteRune change signature.

R=golang-dev, gri, r
CC=golang-dev
https://golang.org/cl/5314043
2011-10-25 22:23:34 -07:00
Russ Cox
7630a107bb unicode, utf8, utf16: use rune
Everything changes.

R=r
CC=golang-dev
https://golang.org/cl/5310045
2011-10-25 22:23:15 -07:00
Russ Cox
cfa036ae3a old/regexp, old/template, template: use rune
Nothing terribly interesting here.

R=r, gri
CC=golang-dev
https://golang.org/cl/5308042
2011-10-25 22:22:42 -07:00
Russ Cox
4911622055 exp/template/html: use rune
Nothing terribly interesting here.

R=mikesamuel, nigeltao, r
CC=golang-dev
https://golang.org/cl/5307044
2011-10-25 22:22:26 -07:00
Russ Cox
8f5718176f bytes, strings: use rune
Various rune-based APIs change.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5306044
2011-10-25 22:22:09 -07:00
Russ Cox
0e513317b1 big: update for fmt interface changes
Nothing terribly interesting here.

R=gri
CC=golang-dev
https://golang.org/cl/5305046
2011-10-25 22:21:49 -07:00
Russ Cox
4e4eca2618 fmt: use rune
Lots of internal edits.

Formatter and Scanner interfaces change
(clients to be checked by govet).

R=r
CC=golang-dev
https://golang.org/cl/5305045
2011-10-25 22:21:33 -07:00
Russ Cox
28c06182c0 exp/winfsnotify: fix govet-found bug
R=golang-dev, hectorchu
CC=golang-dev
https://golang.org/cl/5304044
2011-10-25 22:21:14 -07:00
Russ Cox
3e52dadfd7 regexp: use rune
Public API of syntax tree changes.

R=golang-dev, r, gri
CC=golang-dev
https://golang.org/cl/5302046
2011-10-25 22:20:57 -07:00
Russ Cox
5be33e9543 godoc, exp/ebnf, exp/types, go/scanner, scanner: use rune
API question: is a scanner token an int or a rune?

Since the rune is the common case and the token values
are the special (negative) case, I chose rune.  But it could
easily go the other way.

R=gri
CC=golang-dev
https://golang.org/cl/5301049
2011-10-25 22:20:20 -07:00
Russ Cox
db33959797 cgo, goyacc, go/build, html, http, path, path/filepath, testing/quick, test: use rune
Nothing terribly interesting here.

R=golang-dev, bradfitz, gri, r
CC=golang-dev
https://golang.org/cl/5300043
2011-10-25 22:20:02 -07:00
Russ Cox
6ed3fa6553 gc: introduce rune
R=ken, r
CC=golang-dev
https://golang.org/cl/5293046
2011-10-25 22:19:39 -07:00
Russ Cox
f4568882eb exp/types: add rune to universe
R=gri
CC=golang-dev
https://golang.org/cl/5295045
2011-10-25 22:19:09 -07:00
Andrew Gerrand
5abb29d1b8 undo CL 5302057 / dac58d9c9e4a
need a clean base from weekly.2011-10-25 for rune change

««« original CL description
http: remove Connection header in ReverseProxy

Fixes #2342

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/5302057
»»»

R=rsc
CC=golang-dev
https://golang.org/cl/5294068
2011-10-26 14:16:34 +09:00
Brad Fitzpatrick
7c5d90dfbd http: remove Connection header in ReverseProxy
Fixes #2342

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/5302057
2011-10-25 22:11:01 -07:00
Andrew Balholm
05ed18f4f6 html: improve parsing of lists
Make a <li> tag close the previous <li> element.
Make a </ul> tag close <li> elements.

Pass tests1.dat, test 33:
<!DOCTYPE html><li>hello<li>world<ul>how<li>do</ul>you</body><!--do-->

| <!DOCTYPE html>
| <html>
|   <head>
|   <body>
|     <li>
|       "hello"
|     <li>
|       "world"
|       <ul>
|         "how"
|         <li>
|           "do"
|       "you"
|   <!-- do -->

R=nigeltao
CC=golang-dev
https://golang.org/cl/5321051
2011-10-26 14:02:30 +11:00
Andrew Balholm
6e318bda6c html: improve parsing of tables
When foster parenting, merge adjacent text nodes.
Properly close table row at </tr> tag.

Pass tests1.dat, test 32:
<!-----><font><div>hello<table>excite!<b>me!<th><i>please!</tr><!--X-->

| <!-- - -->
| <html>
|   <head>
|   <body>
|     <font>
|       <div>
|         "helloexcite!"
|         <b>
|           "me!"
|         <table>
|           <tbody>
|             <tr>
|               <th>
|                 <i>
|                   "please!"
|             <!-- X -->

R=nigeltao
CC=golang-dev
https://golang.org/cl/5323048
2011-10-26 11:36:46 +11:00
Ian Lance Taylor
7959aeb0f9 syscall: correct name of mksyscall script in comment
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5310055
2011-10-25 12:49:51 -07:00
Hector Chu
2572ca2ff2 runtime: include bootstrap m in mcpu accounting
R=rsc, dvyukov
CC=golang-dev
https://golang.org/cl/5307052
2011-10-25 08:35:20 +01:00
Brad Fitzpatrick
d72267ae23 http: doc typo
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/5303067
2011-10-24 19:29:44 -07:00
David Anderson
85b9f3573e syscall: use uintptr for Mount flags.
R=bradfitz, rsc
CC=golang-dev
https://golang.org/cl/5308044
2011-10-24 19:28:50 -07:00
Nigel Tao
18b025d530 html: remove the Tokenizer.ReturnComments option.
The original intention was to simplify the parser, in making it skip
all comment tokens. However, checking that the Go html package is
100% compatible with the WebKit HTML test suite requires parsing the
comments. There is no longer any real benefit for the option.

R=gri, andybalholm
CC=golang-dev
https://golang.org/cl/5321043
2011-10-25 11:28:07 +11:00
Dave Cheney
5791233461 exp/ssh: introduce Session to replace Cmd for interactive commands
This CL replaces the Cmd type with a Session type representing
interactive channels. This lays the foundation for supporting
other kinds of channels like direct-tcpip or x11.

client.go:
* replace chanlist map with slice.
* generalize stdout and stderr into a single type.
* unexport ClientChan to clientChan.

doc.go:
* update ServerConfig/ServerConn documentation.
* update Client example for Session.

message.go:
* make channelExtendedData more like channelData.

session.go:
* added Session which replaces Cmd.

R=agl, rsc, n13m3y3r, gustavo
CC=golang-dev
https://golang.org/cl/5302054
2011-10-24 19:13:55 -04:00
Andrew Balholm
2f3f3aa2ed html: dump attributes when running parser tests.
The WebKit test data shows attributes as though they were child nodes:

<a X>0<b>1<a Y>2
dumps as:
| <html>
|   <head>
|   <body>
|     <a>
|       x=""
|       "0"
|       <b>
|         "1"
|     <b>
|       <a>
|         y=""
|         "2"

So we need to do the same when dumping a tree to compare with it.

R=nigeltao
CC=golang-dev
https://golang.org/cl/5322044
2011-10-25 09:33:15 +11:00