219 Commits

Author SHA1 Message Date
b128e7465a merge the conflict 2016-07-28 13:17:23 -07:00
c3a89f91a6 Merge branch 'master' of https://github.com/grpc/grpc-go 2016-07-28 13:04:50 -07:00
ac90a026b6 *: go vet 2016-07-27 23:39:19 -04:00
110450d45e fix races introduce by goaway 2016-07-27 17:27:10 -07:00
8c908a8c1d Reject over-sized requests on server 2016-07-26 16:44:49 -07:00
f78100723d Merge branch 'master' of https://github.com/grpc/grpc-go 2016-07-26 14:04:25 -07:00
b071b83367 limit max msg size on server 2016-07-26 14:04:19 -07:00
f1e4d3b180 allow multiple GoAways and retrying on illegal streams 2016-07-25 16:35:32 -07:00
046e606dc5 clean up 2016-07-21 18:12:01 -07:00
9ad4c58355 Make it work for streaming 2016-07-21 16:19:34 -07:00
873cc272c2 support goaway 2016-07-20 18:48:49 -07:00
7428593149 Merge pull request #759 from menghanl/streams_in_serviceinfo_comments
Fix comments
2016-07-14 10:55:28 -07:00
47de9c3564 server: close only non-closed listeners
The listener can be closed twice: in Close and in Serve. It might lead to
pretty bad things, for example, https://golang.org/src/net/unixsock_posix.go#L340
can delete a file which created by another listener.

Signed-off-by: Alexander Morozov <lk4d4math@gmail.com>
2016-07-12 21:16:45 -07:00
42a2879989 Modify comments 2016-07-11 16:25:52 -07:00
bc8885608f Merge unary RPC info and streaming RPC info 2016-07-11 13:09:50 -07:00
0ea9f970c0 Add StreamInfo for streaming types 2016-07-11 12:09:05 -07:00
a518fa911d Split methods and streams in service info 2016-07-11 12:09:05 -07:00
3802318f46 Make Errorf return pointer to rpcError 2016-07-08 10:28:36 -07:00
078c90026f Minor fixes 2016-06-27 14:51:09 -07:00
26d2db5487 Add server.GetServiceInfo().
To replace server.ServiceMetadata() and server.AllServiceNames().
2016-06-27 12:01:05 -07:00
69c7425a21 Change server.ServiceMetadata to take service name and method name.
And some minor changes.
2016-06-27 12:01:05 -07:00
efe8d5f0f7 Add function AllServiceNames() to Server 2016-06-27 12:01:05 -07:00
e826825578 Add function Metadata() to Server 2016-06-27 12:01:05 -07:00
ad71085be9 Add metadata when registering service 2016-06-27 12:01:05 -07:00
3efe7aef96 Merge pull request #713 from menghanl/split_authenticator_and_credentials
[API revision] Separate TransportAuthenticator and PerRPCCredentials
2016-06-09 14:57:55 -07:00
59486d9c17 Rename TransportAuthenticator to TransportCredentials 2016-06-08 11:19:25 -07:00
7233968957 Add Metadata field to ServiceDesc 2016-06-07 15:40:14 -07:00
6404c49192 Make TransportAuthenticator not embed Credentials 2016-06-06 16:24:46 -07:00
aecdccadd2 Merge pull request #683 from mwitkow/feature/propagate-authority
make :authority propagate to MD
2016-06-01 18:18:23 -07:00
89e77e914d Merge pull request #706 from menghanl/fix_golint
Fix golint
2016-06-01 18:12:45 -07:00
fc590f40e9 Fix golint errors 2016-06-01 16:40:26 -07:00
bab01e8e85 Fix a listener leak when a server is stopped before it starts
If server.Stop() and server.Serve() race, Serve() can return without
closing the listener. This in turn can lead to clients timing out trying
to connect to a server that is neither accepting nor rejecting
connections.
2016-05-22 14:52:40 -04:00
1ef2c5293f fix TestCompressOK and client reserved HTTP header handling 2016-05-17 14:35:18 +01:00
e4bb85b43f Support the stream interceptor on server side. 2016-04-21 14:58:45 -07:00
616cb8ecfe Add the missing comment 2016-04-19 16:33:09 -07:00
310ca08496 gofmt -w 2016-04-19 16:04:09 -07:00
c321387fd9 the installation of server unary interceptor 2016-04-19 15:54:30 -07:00
61e92eacc3 Phase 1 to add the server interceptor 2016-04-18 16:18:34 -07:00
fea7689493 Merge pull request #584 from bradfitz/h2
Simplify server setup when testing the http.Handler-based server transport
2016-03-02 10:59:35 -08:00
18b2da6250 Simplify server setup when testing the http.Handler-based server transport
This simplifies the code that's used for wiring up the http.Handler-based
transport for testing. It's not used outside of tests.

http2.Server.ServeConn was added somewhat recently for other reasons and
I just realized it would simplify this code as well.
2016-03-02 18:49:23 +00:00
0f80f5b995 Remove test-only methods from grpc package.
Move the test-only methods to a new internal package so as to not
pollute the godoc, and to prevent people from using them. (Packages
named internal or under internal are private, and enforced by the go
tool)
2016-02-25 13:30:19 -08:00
89f694edb4 Merge pull request #569 from bradfitz/error_map
Fix crashes where transports returned errors unhandled by the message parser
2016-02-24 18:22:25 -08:00
110fd99e30 Fix crashes where transports returned errors unhandled by the message parser.
The http.Handler-based transport body reader was returning error types
not understood by the recvMsg parser. See #557 for some background and
examples.

Fix the http.Handler transport and add tests. I copied in a subset of
the http2 package's serverTest type, adapted slightly to work with
grpc. In the process of adding tests, I discovered that
ErrUnexpectedEOF was also not handled by the regular server
transport. Document the rules and fix that crash as well.

Unrelated stuff in this CL:

* make tests listen on localhost:0 instead of :0, to avoid Mac firewall
  pop-up dialogs.

* rename parser.s field to parser.r, to be more idiomatic that it's an
  io.Reader and not anything fancier. (it's not acting like type
  stream, even if that's the typical concrete type)

* move 5 byte temp buffer into parser, rather than allocating it for
  each new message. (drop in the bucket improvement in garbage; more
  to do later)

* rename http2RSTErrConvTab to http2ErrConvTab, per Qi's earlier
  CL. Also add the HTTP/1.1-required error mapping for completeness,
  not that it should ever arise with gRPC, also per Qi's earlier CL
  referenced in #557.
2016-02-24 15:09:17 -08:00
75fe76716d log error message and source address in handshake error 2016-02-23 11:14:03 -08:00
7346c871b0 Add a ServeHTTP method to *grpc.Server
This adds new http.Handler-based ServerTransport in the process,
reusing the HTTP/2 server code in x/net/http2 or Go 1.6+.

All end2end tests pass with this new ServerTransport.

Fixes grpc/grpc-go#75

Also:
Updates grpc/grpc-go#495 (lets user fix it with middleware in front)
Updates grpc/grpc-go#468 (x/net/http2 validates)
Updates grpc/grpc-go#147 (possible with x/net/http2)
Updates grpc/grpc-go#104 (x/net/http2 does this)
2016-02-12 00:16:28 +00:00
07d3de883f Update Server.Stop docs per code review comments from grpc/grpc-go#540 2016-02-09 23:50:03 +00:00
854ad3492a refine the comments of grpc.Server.Stop() 2016-02-09 15:22:53 -08:00
77ccaa8fb2 Close ServerTransport instead of the raw connection 2016-02-08 14:27:06 -08:00
93591e7568 Merge pull request #508 from bradfitz/master
server: break up the Server.Serve method into some reusable parts
2016-01-29 15:51:48 -08:00
9d2ecf553a server: break up the Server.Serve method into some reusable parts
Updates grpc/grpc-go#75
2016-01-29 23:20:54 +00:00