mirror of
https://github.com/minio/minio.git
synced 2025-11-20 01:50:24 -05:00
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:
15
cmd/posix.go
15
cmd/posix.go
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user