Implement HTTP POST based RPC (#5840)

Added support for new RPC support using HTTP POST.  RPC's 
arguments and reply are Gob encoded and sent as HTTP 
request/response body.

This patch also removes Go RPC based implementation.
This commit is contained in:
Bala FA
2018-06-06 14:21:56 +05:30
committed by Nitish Tiwari
parent 9d41051e91
commit 6a53dd1701
59 changed files with 5272 additions and 4169 deletions

View File

@@ -137,7 +137,6 @@ func isDirEmpty(dirname string) bool {
return false
}
defer f.Close()
// List one entry.
_, err = f.Readdirnames(1)
if err != io.EOF {
@@ -152,14 +151,15 @@ func isDirEmpty(dirname string) bool {
}
// Initialize a new storage disk.
func newPosix(path string) (StorageAPI, error) {
func newPosix(path string) (*posix, error) {
var err error
if path, err = getValidPath(path); err != nil {
return nil, err
}
st := &posix{
diskPath: path,
p := &posix{
connected: true,
diskPath: path,
// 1MiB buffer pool for posix internal operations.
pool: sync.Pool{
New: func() interface{} {
@@ -170,12 +170,10 @@ func newPosix(path string) (StorageAPI, error) {
stopUsageCh: make(chan struct{}),
}
st.connected = true
go st.diskUsage(globalServiceDoneCh)
go p.diskUsage(globalServiceDoneCh)
// Success.
return st, nil
return p, nil
}
// getDiskInfo returns given disk information.
@@ -285,6 +283,7 @@ func (s *posix) DiskInfo() (info DiskInfo, err error) {
Free: di.Free,
Used: atomic.LoadUint64(&s.totalUsed),
}, nil
}
// getVolDir - will convert incoming volume names to