1. 11 Dec, 2015 9 commits
  2. 10 Dec, 2015 11 commits
    • Brad Fitzpatrick's avatar
      syscall: fix duplicated copyright header in mksysnum_plan9.sh · 251e5006
      Brad Fitzpatrick authored
      Fixes #13569
      
      Change-Id: I04c9a44437414177e2fee260518cfe53a67e6364
      Reviewed-on: https://go-review.googlesource.com/17684Reviewed-by: 's avatarRob Pike <r@golang.org>
      251e5006
    • Russ Cox's avatar
      net/url: add tests for RequestURI returning //paths · 503cbcef
      Russ Cox authored
      Fixes #10433.
      
      Change-Id: I2a8b54e3f07488f204b1d14eb2603842caaf1e5a
      Reviewed-on: https://go-review.googlesource.com/17386Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      503cbcef
    • Keith Randall's avatar
      cmd/compile: captureless closures are constants · 4f97ec08
      Keith Randall authored
      In particular, we can initialize globals with them at link time instead
      of generating code for them in an init() function.  Less code, less
      startup cost.
      
      But the real reason for this change is binary size.  This change reduces
      the binary size of hello world by ~4%.
      
      The culprit is fmt.ssFree, a global variable which is a sync.Pool of
      scratch scan states.  It is initalized with a captureless closure as the
      pool's New action.  That action in turn references all the scanf code.
      
      If you never call any of the fmt.Scanf* routines, ssFree is never used.
      But before this change, ssFree is still referenced by fmt's init
      function.  That keeps ssFree and all the code it references in the
      binary.  With this change, ssFree is initialized at link time.  As a
      result, fmt.init never mentions ssFree.  If you don't call fmt.Scanf*,
      ssFree is unreferenced and it and the scanf code are not included.
      
      This change is an easy fix for what is generally a much harder problem,
      the unnecessary initializing of unused globals (and retention of code
      that they reference).  Ideally we should have separate init code for
      each global and only include that code if the corresponding global is
      live.  (We'd need to make sure that the initializing code has no side
      effects, except on the global being initialized.)  That is a much harder
      change.
      
      Update #6853
      
      Change-Id: I19d1e33992287882c83efea6ce113b7cfc504b67
      Reviewed-on: https://go-review.googlesource.com/17398Reviewed-by: 's avatarRuss Cox <rsc@golang.org>
      Run-TryBot: Russ Cox <rsc@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      4f97ec08
    • Rob Pike's avatar
      time: reject invalid day of month in Parse · 5ef89911
      Rob Pike authored
      There was back-and-forth on this but it has been decided to fix the original
      complaint, which was easy.
      
      Fixes #7268.
      
      Change-Id: I6b607c49ad44579086aba2c4f4c5424b97fbed64
      Reviewed-on: https://go-review.googlesource.com/17710Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      Reviewed-by: 's avatarRuss Cox <rsc@golang.org>
      5ef89911
    • Brad Fitzpatrick's avatar
      net/http/httptest: don't crash in mime sniffing if HeaderMap is nil · 9ccdc4ed
      Brad Fitzpatrick authored
      Fixes some failing Google tests when run under Go tip (1.6).
      
      Updates #12986
      
      Change-Id: I0ca4d20f6103d10ea9464e45730085401336dada
      Reviewed-on: https://go-review.googlesource.com/17698Reviewed-by: 's avatarRuss Cox <rsc@golang.org>
      Reviewed-by: 's avatarNodir Turakulov <nodir@google.com>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      9ccdc4ed
    • Brad Fitzpatrick's avatar
      net/http: make NewRequest with empty method mean GET · 8233ecd1
      Brad Fitzpatrick authored
      Until recently, we always permitted an empty string to NewRequest.
      Keep that property, since it broke tests within in Google when trying
      out Go 1.6, and probably would've broken others too.
      
      Change-Id: Idddab1ae7b9423d5caac00af2c897fe1065b600b
      Reviewed-on: https://go-review.googlesource.com/17699Reviewed-by: 's avatarRuss Cox <rsc@golang.org>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      8233ecd1
    • Rob Pike's avatar
      doc: go1.6.txt: go doc searches in breadth-first order · 9d6e4b7e
      Rob Pike authored
      Change-Id: I12a43b15e81a5e0b174c1c49e77f8307c567233b
      Reviewed-on: https://go-review.googlesource.com/17697Reviewed-by: 's avatarRob Pike <r@golang.org>
      9d6e4b7e
    • Rob Pike's avatar
      cmd/doc: search the tree in breadth-first order · 2aa58744
      Rob Pike authored
      This is a simple change to the command that should resolve problems like finding
      vendored packages before their non-vendored siblings. By searching in breadth-first
      order, we find the matching package lowest in the hierarchy, which is more likely
      to be correct than the deeper one, such as a vendored package, that will be found
      in a depth-first scan.
      
      This may be sufficient to resolve the issue, and has the merit that it is very easy
      to explain. I will leave the issue open for now in case my intuition is wrong.
      
      Update #12423
      
      Change-Id: Icf69e8beb1845277203fcb7d19ffb7cca9fa41f5
      Reviewed-on: https://go-review.googlesource.com/17691Reviewed-by: 's avatarRuss Cox <rsc@golang.org>
      2aa58744
    • Robert Griesemer's avatar
      cmd/compile: don't truncate tiny float constants to 0 in error messages · 732e2cd7
      Robert Griesemer authored
      Fixes #13559.
      
      Change-Id: I6fe8b5083192e8eb6c1b3ca1919fde81a00ccb7e
      Reviewed-on: https://go-review.googlesource.com/17695
      Run-TryBot: Robert Griesemer <gri@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarAlan Donovan <adonovan@google.com>
      732e2cd7
    • Mikio Hara's avatar
      net, internal/syscall/windows: fix interface and address identification on windows · e05b48e2
      Mikio Hara authored
      The current implementation including Go 1.5 through 1.5.2 misuses
      Windows API and mishandles the returned values from GetAdapterAddresses
      on Windows. This change fixes various issues related to network facility
      information by readjusting interface and interface address parsers.
      
      Updates #5395.
      Updates #10530.
      Updates #12301.
      Updates #12551.
      Updates #13542.
      Fixes #12691.
      Fixes #12811.
      Fixes #13476.
      Fixes #13544.
      
      Also fixes fragile screen scraping test cases in net_windows_test.go.
      
      Additional information for reviewers:
      
      It seems like almost all the issues above have the same root cause and
      it is misunderstanding of Windows API. If my interpretation of the
      information on MSDN is correctly, current implementation contains the
      following bugs:
      
      - SIO_GET_INTERFACE_LIST should not be used for IPv6. The behavior of
        SIO_GET_INTERFACE_LIST is different on kernels and probably it doesn't
        work correctly for IPv6 on old kernels such as Windows XP w/ SP2.
        Unfortunately MSDN doesn't describe the detail of
        SIO_GET_INTERFACE_LIST, but information on the net suggests so.
      
      - Fetching IP_ADAPTER_ADDRESSES structures with fixed size area may not
        work when using IPv6. IPv6 generates ton of interface addresses for
        various addressing scopes. We need to adjust the area appropriately.
      
      - PhysicalAddress field of IP_ADAPTER_ADDRESSES structure may have extra
        space. We cannot ignore PhysicalAddressLength field of
        IP_ADAPTER_ADDRESS structure.
      
      - Flags field of IP_ADAPTER_ADDRESSES structure doesn't represent any of
        administratively and operatinal statuses. It just represents settings
        for windows network adapter.
      
      - MTU field of IP_ADAPTER_ADDRESSES structure may have a uint32(-1) on
        64-bit platform. We need to convert the value to interger
        appropriately.
      
      - IfType field of IP_ADAPTER_ADDRESSES structure is not a bit field.
        Bitwire operation for the field is completely wrong.
      
      - OperStatus field of IP_ADAPTER_ADDRESSES structure is not a bit field.
        Bitwire operation for the field is completely wrong.
      
      - IPv6IfIndex field of IP_ADAPTER_ADDRESSES structure is just a
        substitute for IfIndex field. We cannot prefer IPv6IfIndex to IfIndex.
      
      - Windows XP, 2003 server and below don't set OnLinkPrefixLength field
        of IP_ADAPTER_UNICAST_ADDRESS structure. We cannot rely on the field
        on old kernels. We can use FirstPrefix field of IP_ADAPTER_ADDRESSES
        structure and IP_ADAPTER_PREFIX structure instead.
      
      - Length field of IP_ADAPTER_{UNICAST,ANYCAST,MULTICAST}_ADDRESS
        sturecures doesn't represent an address prefix length. It just
        represents a socket address length.
      
      Change-Id: Icabdaf7bd1d41360a981d2dad0b830b02b584528
      Reviewed-on: https://go-review.googlesource.com/17412Reviewed-by: 's avatarAlex Brainman <alex.brainman@gmail.com>
      e05b48e2
    • Brad Fitzpatrick's avatar
      net/http: run more tests in http2 mode · c2ef0054
      Brad Fitzpatrick authored
      Failing ones are marked skipped.
      
      Fixes #13543 (was just a test issue)
      Updates #13555 (to be fixed later)
      Updates #13556 (to be fixed later)
      Updates #13557 (to be fixed later)
      Fixes bug in golang.org/cl/17428 (http1 now uses HTTP status 431, not 413)
      
      Change-Id: I8f7431fee35f2fc081cfe2c232ae75a00800a60b
      Reviewed-on: https://go-review.googlesource.com/17683Reviewed-by: 's avatarBlake Mizerany <blake.mizerany@gmail.com>
      Reviewed-by: 's avatarEmmanuel Odeke <emm.odeke@gmail.com>
      Reviewed-by: 's avatarBurcu Dogan <jbd@google.com>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      c2ef0054
  3. 09 Dec, 2015 17 commits
  4. 08 Dec, 2015 3 commits