Skip to content

Commit

Permalink
Revert " channelz: stage 4 - add security and socket option info" (#2124
Browse files Browse the repository at this point in the history
)

Reverts #2098

Appengine will fail with the error below:
```
go-app-builder: Failed parsing input: parser: bad import "syscall" in google.golang.org/grpc/channelz/funcs.go from GOPATH
```

The root cause of it is in type_linux.go.
https://github.com/grpc/grpc-go/blob/629f6bc5e559f3a278d922c79f46678030797db3/channelz/types_linux.go#L21-L25
  • Loading branch information
lyuxuan authored and menghanl committed Jun 6, 2018
1 parent 629f6bc commit 96cefb4
Show file tree
Hide file tree
Showing 24 changed files with 73 additions and 1,121 deletions.
103 changes: 0 additions & 103 deletions channelz/service/func_linux.go

This file was deleted.

30 changes: 0 additions & 30 deletions channelz/service/func_nonlinux.go

This file was deleted.

34 changes: 0 additions & 34 deletions channelz/service/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,17 @@ package service

import (
"net"
"time"

"github.com/golang/protobuf/ptypes"
durpb "github.com/golang/protobuf/ptypes/duration"
wrpb "github.com/golang/protobuf/ptypes/wrappers"
"golang.org/x/net/context"
"google.golang.org/grpc"
"google.golang.org/grpc/channelz"
channelzgrpc "google.golang.org/grpc/channelz/grpc_channelz_v1"
channelzpb "google.golang.org/grpc/channelz/grpc_channelz_v1"
"google.golang.org/grpc/connectivity"
"google.golang.org/grpc/credentials"
)

func convertToPtypesDuration(sec int64, usec int64) *durpb.Duration {
return ptypes.DurationProto(time.Duration(sec*1e9 + usec*1e3))
}

// RegisterChannelzServiceToServer registers the channelz service to the given server.
func RegisterChannelzServiceToServer(s *grpc.Server) {
channelzgrpc.RegisterChannelzServer(s, &serverImpl{})
Expand Down Expand Up @@ -135,26 +128,6 @@ func subChannelMetricToProto(cm *channelz.SubChannelMetric) *channelzpb.Subchann
return sc
}

func securityToProto(se credentials.ChannelzSecurityValue) *channelzpb.Security {
switch v := se.(type) {
case *credentials.TLSChannelzSecurityValue:
return &channelzpb.Security{Model: &channelzpb.Security_Tls_{Tls: &channelzpb.Security_Tls{
CipherSuite: &channelzpb.Security_Tls_StandardName{StandardName: v.StandardName},
LocalCertificate: v.LocalCertificate,
RemoteCertificate: v.RemoteCertificate,
}}}
case *credentials.OtherChannelzSecurityValue:
otherSecurity := &channelzpb.Security_OtherSecurity{
Name: v.Name,
}
if anyval, err := ptypes.MarshalAny(v.Value); err == nil {
otherSecurity.Value = anyval
}
return &channelzpb.Security{Model: &channelzpb.Security_Other{Other: otherSecurity}}
}
return nil
}

func addrToProto(a net.Addr) *channelzpb.Address {
switch a.Network() {
case "udp":
Expand Down Expand Up @@ -202,13 +175,6 @@ func socketMetricToProto(sm *channelz.SocketMetric) *channelzpb.Socket {
s.Data.LocalFlowControlWindow = &wrpb.Int64Value{Value: sm.SocketData.LocalFlowControlWindow}
s.Data.RemoteFlowControlWindow = &wrpb.Int64Value{Value: sm.SocketData.RemoteFlowControlWindow}

if sm.SocketData.SocketOptions != nil {
s.Data.Option = sockoptToProto(sm.SocketData.SocketOptions)
}
if sm.SocketData.Security != nil {
s.Security = securityToProto(sm.SocketData.Security)
}

if sm.SocketData.LocalAddr != nil {
s.Local = addrToProto(sm.SocketData.LocalAddr)
}
Expand Down
196 changes: 0 additions & 196 deletions channelz/service/service_linux_test.go

This file was deleted.

Loading

0 comments on commit 96cefb4

Please sign in to comment.