Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server-side CHUNKING and BINARYMIME support #104

Closed
wants to merge 6 commits into from

Conversation

foxcpp
Copy link
Collaborator

@foxcpp foxcpp commented Jun 11, 2020

See #81. This issue is not closed since it also references client support.

@codecov
Copy link

codecov bot commented Jun 11, 2020

Codecov Report

Merging #104 into master will increase coverage by 2.12%.
The diff coverage is 70.76%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #104      +/-   ##
==========================================
+ Coverage   62.52%   64.64%   +2.12%     
==========================================
  Files           8        9       +1     
  Lines         982     1140     +158     
==========================================
+ Hits          614      737     +123     
- Misses        275      302      +27     
- Partials       93      101       +8     
Impacted Files Coverage Δ
smtp.go 100.00% <ø> (ø)
conn.go 59.36% <57.62%> (+0.01%) ⬆️
chunk_reader.go 100.00% <100.00%> (ø)
server.go 62.24% <100.00%> (+6.12%) ⬆️
parse.go 57.89% <0.00%> (+5.26%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 451381b...e797215. Read the comment docs.

chunk_reader.go Outdated Show resolved Hide resolved
chunk_reader.go Outdated Show resolved Hide resolved
Copy link
Owner

@emersion emersion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of this chunkReader approach, can't we read data directly from handleBdat and forward it to the backend via an io.Pipe?

pr, pw := io.Pipe()
go c.Session().Data(pr)
lr := io.LimitedReader{R: c.text.R, N: size}
io.Copy(pw, lr)

@foxcpp
Copy link
Collaborator Author

foxcpp commented Jun 22, 2020

Instead of this chunkReader approach, can't we read data directly from handleBdat and forward it to the backend via an io.Pipe?

I wanted to preserve ability for backend to return errors without consuming the whole message but I will look if this is easily possible with io.Pipe.

@emersion
Copy link
Owner

I wanted to preserve ability for backend to return errors without consuming the whole message but I will look if this is easily possible with io.Pipe.

io.PipeReader.CloseWithError could help.

@foxcpp foxcpp closed this Jun 23, 2020
@foxcpp foxcpp deleted the chunking branch January 17, 2021 14:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants