Skip to content

Runtime panic handling http traffic in rpc #1598

@gopherbot

Description

@gopherbot

by phanna@google.com:

Before filing a bug, please check whether it has been fixed since
the latest release: run "hg pull -u" and retry what you did to
reproduce the problem.  Thanks.

What steps will reproduce the problem?
1. Create an rpc server that does not serve http.
2. Connect to the port using a browser
3. Program panics

What is the expected output?
404 or some other error.

What do you see instead?
runtime panic

Which compiler are you using (5g, 6g, 8g, gccgo)?
6g

Which operating system are you using?
Linux

Which revision are you using?  (hg identify)
7570d405bc93

Please provide any additional information below.
Code snippet:

func main() {
  server := rpc.NewServer()
  server.Register(new(Service)) // Some trivial rpc class
  l, _ := net.Listen("tpc", ":8888")
  server.Accept(l)
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions