]> git.immae.eu Git - github/fretlink/terraform-provider-statuscake.git/blobdiff - vendor/google.golang.org/grpc/internal/channelz/util_linux.go
Upgrade to 0.12
[github/fretlink/terraform-provider-statuscake.git] / vendor / google.golang.org / grpc / internal / channelz / util_linux.go
similarity index 58%
rename from vendor/google.golang.org/grpc/credentials/credentials_util_go18.go
rename to vendor/google.golang.org/grpc/internal/channelz/util_linux.go
index 93f0e1d8de23a5e934b1748179fadc0716fa40c6..fdf409d55de3b45fbc85805d9d01775bba382590 100644 (file)
@@ -1,8 +1,8 @@
-// +build go1.8
+// +build linux,!appengine
 
 /*
  *
- * Copyright 2017 gRPC authors.
+ * Copyright 2018 gRPC authors.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  *
  */
 
-package credentials
+package channelz
 
 import (
-       "crypto/tls"
+       "syscall"
 )
 
-// cloneTLSConfig returns a shallow clone of the exported
-// fields of cfg, ignoring the unexported sync.Once, which
-// contains a mutex and must not be copied.
-//
-// If cfg is nil, a new zero tls.Config is returned.
-func cloneTLSConfig(cfg *tls.Config) *tls.Config {
-       if cfg == nil {
-               return &tls.Config{}
+// GetSocketOption gets the socket option info of the conn.
+func GetSocketOption(socket interface{}) *SocketOptionData {
+       c, ok := socket.(syscall.Conn)
+       if !ok {
+               return nil
        }
-
-       return cfg.Clone()
+       data := &SocketOptionData{}
+       if rawConn, err := c.SyscallConn(); err == nil {
+               rawConn.Control(data.Getsockopt)
+               return data
+       }
+       return nil
 }