Skip to content

Commit

Permalink
remove some unused codes.
Browse files Browse the repository at this point in the history
  • Loading branch information
jjeffcaii committed Aug 6, 2019
1 parent 7a98012 commit dc0faa0
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 89 deletions.
55 changes: 0 additions & 55 deletions cmd/foobar/main.go

This file was deleted.

1 change: 0 additions & 1 deletion internal/fragmentation/joiner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ func TestFragmentPayload(t *testing.T) {
const totals = 10
const sid = uint32(1)
fr := NewJoiner(framing.NewFramePayload(sid, []byte("(ROOT)"), []byte("(ROOT)"), framing.FlagFollow, framing.FlagMetadata))
defer fr.Release()
for i := 0; i < totals; i++ {
data := fmt.Sprintf("(data%04d)", i)
var frame *framing.FramePayload
Expand Down
1 change: 0 additions & 1 deletion internal/fragmentation/splitter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ func TestSplitter_Split(t *testing.T) {

joiner, err := split2joiner(mtu, data, metadata)
assert.NoError(t, err, "split failed")
defer joiner.Release()

m, ok := joiner.Metadata()
assert.True(t, ok, "bad metadata")
Expand Down
12 changes: 0 additions & 12 deletions internal/framing/frame_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ func TestDecode_Payload(t *testing.T) {
//s := "000000012940000005776f726c6468656c6c6f" // go
s := "00000001296000000966726f6d5f6a617661706f6e67" //java



bs, err := hex.DecodeString(s)
assert.NoError(t, err, "bad bytes")
h := ParseFrameHeader(bs[:HeaderLen])
Expand All @@ -24,15 +22,5 @@ func TestDecode_Payload(t *testing.T) {
pl := &FramePayload{
BaseFrame: NewBaseFrame(h, bf),
}
defer pl.Release()
log.Println(pl)









}
1 change: 0 additions & 1 deletion internal/socket/duplex.go
Original file line number Diff line number Diff line change
Expand Up @@ -835,7 +835,6 @@ func (p *DuplexRSocket) sendPayload(
BaseFrame: framing.NewBaseFrame(h, body),
})
})
return
}

func (p *DuplexRSocket) drainWithKeepalive() (ok bool) {
Expand Down
19 changes: 0 additions & 19 deletions payload/payload.go
Original file line number Diff line number Diff line change
@@ -1,20 +1,12 @@
package payload

import (
"errors"
"fmt"
"io/ioutil"
"os"
"time"

"github.com/rsocket/rsocket-go/internal/common"
)

var (
errNotFile = errors.New("target is not file")
errTooLargePooledPayload = fmt.Sprintf("too large pooled payload: maximum size is %d", common.MaxUint24-3)
)

type (
// Payload is a stream message (upstream or downstream).
// It contains data associated with a stream created by a previous request.
Expand Down Expand Up @@ -82,17 +74,6 @@ func NewString(data, metadata string) Payload {

// NewFile create a new payload from file.
func NewFile(filename string, metadata []byte) (Payload, error) {
fi, err := os.Stat(filename)
if err != nil {
return nil, err
}
if fi.IsDir() {
return nil, errNotFile
}
// Check file size
//if fi.Size() > common.MaxUint24 {
// return nil, errTooLargeFile
//}
bs, err := ioutil.ReadFile(filename)
if err != nil {
return nil, err
Expand Down

0 comments on commit dc0faa0

Please sign in to comment.