From c3376e9d3a64fe0b68268996df8311cc7467baa8 Mon Sep 17 00:00:00 2001 From: Sarah Jamie Lewis Date: Thu, 2 Sep 2021 13:01:07 -0700 Subject: [PATCH] Fix merge conflicts --- protocol/connections/engine.go | 28 ---------------------------- protocol/connections/peerapp.go | 13 ------------- 2 files changed, 41 deletions(-) diff --git a/protocol/connections/engine.go b/protocol/connections/engine.go index 75166fc..1623d89 100644 --- a/protocol/connections/engine.go +++ b/protocol/connections/engine.go @@ -7,10 +7,8 @@ import ( "cwtch.im/cwtch/protocol/groups" model3 "cwtch.im/cwtch/protocol/model" "encoding/base64" - "encoding/hex" "encoding/json" "errors" - "fmt" "git.openprivacy.ca/cwtch.im/tapir" "git.openprivacy.ca/cwtch.im/tapir/applications" "git.openprivacy.ca/cwtch.im/tapir/networks/tor" @@ -21,7 +19,6 @@ import ( "github.com/gtank/ristretto255" "golang.org/x/crypto/ed25519" "strconv" - "strings" "sync" "time" ) @@ -214,31 +211,6 @@ func (e *engine) eventHandler() { } } -func (e *engine) fetchManifest(handle string, fileKey string, manifestSize uint64) { - // Store a blank manifest - e.manifests.Store(fileKey, strings.Repeat("\"", int(manifestSize*files.DefaultChunkSize))) - conn, err := e.service.WaitForCapabilityOrClose(handle, cwtchCapability) - if err == nil { - peerApp, ok := (conn.App()).(*PeerApp) - if ok { - peerApp.FetchManifestChunks(fileKey) - } - } -} - -func (e *engine) sendManifestChunk(handle string, fileKey string, id uint64, chunk []byte) { - conn, err := e.service.WaitForCapabilityOrClose(handle, cwtchCapability) - if err == nil { - peerApp, ok := (conn.App()).(*PeerApp) - if ok { - peerApp.SendMessage(PeerMessage{ - Context: event.ContextSendManifest, - ID: fmt.Sprintf("%s.%d", fileKey, id), - Data: chunk, - }) - } - } -} func (e *engine) isBlocked(onion string) bool { authorization, known := e.authorizations.Load(onion) diff --git a/protocol/connections/peerapp.go b/protocol/connections/peerapp.go index 4c07516..4d68d01 100644 --- a/protocol/connections/peerapp.go +++ b/protocol/connections/peerapp.go @@ -117,17 +117,4 @@ func (pa *PeerApp) SendMessage(message model2.PeerMessage) { } serialized, _ := json.Marshal(message) pa.connection.Send(serialized) -} - -func (pa *PeerApp) FetchManifestChunks(key string) { - - message := PeerMessage{ - Context: event.ContextRequestManifest, - ID: key, - Data: []byte{}, - } - - serialized, _ := json.Marshal(message) - pa.connection.Send(serialized) - } \ No newline at end of file