1. 23 Aug, 2011 11 commits
    • Robert Griesemer's avatar
      go/parser: fix type switch scoping · f6d536be
      Robert Griesemer authored
      Introduce extra scope for the variable declared by a
      TypeSwitchGuard so that it doesn't conflict with vars
      declared by the initial SimpleStmt of a type switch.
      
      This is a replacement for CL 4896053 which caused
      a build breakage.
      
      Also:
      - explicitly detect type switches (as opposed to detecting
        expression switches and then do extra testing for type switches)
      - fix all outstanding TODOs in parser.go
      - ran all tests
      
      R=rsc
      CC=golang-dev
      https://golang.org/cl/4914044
      f6d536be
    • Brad Fitzpatrick's avatar
      http: add MaxBytesReader to limit request body size · f0ef4f47
      Brad Fitzpatrick authored
      This adds http.MaxBytesReader, similar to io.LimitReader,
      but specific to http, and for preventing a class of DoS
      attacks.
      
      This also makes the 10MB ParseForm limit optional (if
      not already set by a MaxBytesReader), documents it,
      and also adds "PUT" as a valid verb for parsing forms
      in the request body.
      
      Improves issue 2093 (DoS protection)
      Fixes #2165 (PUT form parsing)
      
      R=golang-dev, adg
      CC=golang-dev
      https://golang.org/cl/4921049
      f0ef4f47
    • Rob Pike's avatar
      effective go: fix erroneous quoting of ampersands that cropped up · 6731d47f
      Rob Pike authored
      R=golang-dev, rsc
      CC=golang-dev
      https://golang.org/cl/4937047
      6731d47f
    • Russ Cox's avatar
      runtime: simplify stack traces · 03e9ea5b
      Russ Cox authored
      Make the stack traces more readable for new
      Go programmers while preserving their utility for old hands.
      
      - Change status number [4] to string.
      - Elide frames in runtime package (internal details).
      - Swap file:line and arguments.
      - Drop 'created by' for main goroutine.
      - Show goroutines in order of allocation:
        implies main goroutine first if nothing else.
      
      There is no option to get the extra frames back.
      Uncomment 'return 1' at the bottom of symtab.c.
      
      $ 6.out
      throw: all goroutines are asleep - deadlock!
      
      goroutine 1 [chan send]:
      main.main()
             /Users/rsc/g/go/src/pkg/runtime/x.go:22 +0x8a
      
      goroutine 2 [select (no cases)]:
      main.sel()
             /Users/rsc/g/go/src/pkg/runtime/x.go:11 +0x18
      created by main.main
             /Users/rsc/g/go/src/pkg/runtime/x.go:19 +0x23
      
      goroutine 3 [chan receive]:
      main.recv(0xf8400010a0, 0x0)
             /Users/rsc/g/go/src/pkg/runtime/x.go:15 +0x2e
      created by main.main
             /Users/rsc/g/go/src/pkg/runtime/x.go:20 +0x50
      
      goroutine 4 [chan receive (nil chan)]:
      main.recv(0x0, 0x0)
             /Users/rsc/g/go/src/pkg/runtime/x.go:15 +0x2e
      created by main.main
             /Users/rsc/g/go/src/pkg/runtime/x.go:21 +0x66
      $
      
      $ 6.out index
      panic: runtime error: index out of range
      
      goroutine 1 [running]:
      main.main()
              /Users/rsc/g/go/src/pkg/runtime/x.go:25 +0xb9
      $
      
      $ 6.out nil
      panic: runtime error: invalid memory address or nil pointer dereference
      [signal 0xb code=0x1 addr=0x0 pc=0x22ca]
      
      goroutine 1 [running]:
      main.main()
              /Users/rsc/g/go/src/pkg/runtime/x.go:28 +0x211
      $
      
      $ 6.out panic
      panic: panic
      
      goroutine 1 [running]:
      main.main()
              /Users/rsc/g/go/src/pkg/runtime/x.go:30 +0x101
      $
      
      R=golang-dev, qyzhai, n13m3y3r, r
      CC=golang-dev
      https://golang.org/cl/4907048
      03e9ea5b
    • Lucio De Re's avatar
      ld: handle Plan 9 ar format · 45407bd5
      Lucio De Re authored
      The Go version has 64 character long section names; originally,
      in Plan 9, the limit was 16.  To provide compatibility, this
      change allows the input length to be either the target length
      or the earlier option.	The section name is extended with spaces
      where required.
      
      This has been tested to work without regressions in the
      Go environment, testing the older alternative has not been
      possible yet.
      
      R=rsc
      CC=golang-dev
      https://golang.org/cl/4650071
      45407bd5
    • Joel Sing's avatar
      syscall: openbsd amd64 syscall support · bf2d403d
      Joel Sing authored
      Add support for syscalls on openbsd amd64. This is based on the
      existing freebsd amd64 implementation.
      
      R=mikioh.mikioh, rsc, yourcomputerpal
      CC=golang-dev
      https://golang.org/cl/4798060
      bf2d403d
    • Joel Sing's avatar
      build: add openbsd · be00d38a
      Joel Sing authored
      R=golang-dev, rsc
      CC=golang-dev
      https://golang.org/cl/4832047
      be00d38a
    • Joel Sing's avatar
      os: disable Hostname test on OpenBSD · a9fe3a0c
      Joel Sing authored
      R=golang-dev, rsc
      CC=golang-dev
      https://golang.org/cl/4901054
      a9fe3a0c
    • Russ Cox's avatar
      ld: remove duplicate bss definitions · 35543259
      Russ Cox authored
      The EXTERN lines in elf.h already define these.
      That's not a problem for most C compilers, but
      apparently it is for some copies of the OS X linker.
      
      Fixes #2167.
      
      R=golang-dev, iant
      CC=golang-dev
      https://golang.org/cl/4936044
      35543259
    • Nigel Tao's avatar
      exp/template/html: differentiate URL-valued attributes (such as href) · 9969803f
      Nigel Tao authored
      from others (such as title) during escaping.
      
      R=r, mikesamuel, dsymonds
      CC=golang-dev
      https://golang.org/cl/4919042
      9969803f
    • Robert Griesemer's avatar
      go/ast: generalize ast.FilterFile · d8594f3d
      Robert Griesemer authored
      ast.FilterFile(src, ast.IsExported) has the same
      effect as ast.FileExports(src) with this change.
      
      1st step towards removing FileExports - it is
      just a special case of FilterFile with this CL.
      
      Added corresponding test.
      
      R=r
      CC=golang-dev
      https://golang.org/cl/4938041
      d8594f3d
  2. 22 Aug, 2011 17 commits
  3. 21 Aug, 2011 3 commits
  4. 20 Aug, 2011 4 commits
  5. 19 Aug, 2011 3 commits
  6. 18 Aug, 2011 2 commits
    • Brad Fitzpatrick's avatar
      mime: ParseMediaType returns os.Error now, not a nil map · a986d980
      Brad Fitzpatrick authored
      ParseMediaType previously documented that it always returned
      a non-nil map, but also documented that it returned a nil map
      to signal an error.
      
      That is confusing, contradictory and not Go-like.
      
      Now it returns (mediatype string, params map, os.Error).
      
      R=golang-dev, r
      CC=golang-dev
      https://golang.org/cl/4867054
      a986d980
    • Robert Griesemer's avatar
      undo CL 4896053 / c62cf48b7dc4: fix build · 88432625
      Robert Griesemer authored
      The subtle AST changes introduced with CL 4896053
      broke type checking of type switches in gofix.
      Coming up with a correct fix will take some time.
      Undoing this change for now.
      
      ««« original CL description
      go/parser: fix type switch scoping
      
      The variable declared by a TypeSwitchGuard must be
      visible in each TypeCaseClause and must not conflict
      with other variables declared by the initial SimpleStmt
      of a type switch.
      
      Also:
      - explicitly detect type switches (as opposed to detecting
        regular (expression switches) and then do extra testing
        for type switches
      - fix all outstanding TODOs in parser.go
      
      R=rsc
      CC=golang-dev
      https://golang.org/cl/4896053
      »»»
      
      R=rsc
      CC=golang-dev
      https://golang.org/cl/4902052
      88432625