()
| 193 | } |
| 194 | |
| 195 | func (f *fromChannel) Recv() (*proto.FileUpload, error) { |
| 196 | next, ok := <-f.requests |
| 197 | if !ok { |
| 198 | return nil, xerrors.New("channel closed") |
| 199 | } |
| 200 | |
| 201 | // Only file download messages are expected here. |
| 202 | file := next.GetFile() |
| 203 | if file == nil { |
| 204 | return nil, xerrors.Errorf("expected file upload") |
| 205 | } |
| 206 | |
| 207 | return file, nil |
| 208 | } |
| 209 | |
| 210 | func (s *Session) handleInitRequest(init *proto.InitRequest, requests <-chan *proto.Request) (*proto.InitComplete, error) { |
| 211 | req := &InitRequest{ |