Keyboard Shortcuts

File
u :up to issue
m :publish + mail comments
M :edit review message
j / k :jump to file after / before current file
J / K :jump to next file with a comment after / before current file
Side-by-side diff
i :toggle intra-line diffs
e :expand all comments
c :collapse all comments
s :toggle showing all comments
n / p :next / previous diff chunk or comment
N / P :next / previous comment
<Up> / <Down> :next / previous line
<Enter> :respond to / edit current comment
d :mark current comment as done
Issue
u :up to list of issues
m :publish + mail comments
j / k :jump to patch after / before current patch
o / <Enter> :open current patch in side-by-side view
i :open current patch in unified diff view
Issue List
j / k :jump to issue after / before current issue
o / <Enter> :open current issue
# : close issue
Comment/message editing
<Ctrl> + s or <Ctrl> + Enter :save comment
<Esc> :cancel edit
Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(44)
Issues Repositories Search
Open Issues | Closed Issues | All Issues | Sign in with your Google Account to create issues and add comments

Issue 6405072: code review 6405072: textproto: new field serialization routine

Can't Edit
Can't Publish+Mail
Start Review
Created:
13 years, 5 months ago by pascal
Modified:
13 years, 5 months ago
Reviewers:
adg, rsc, bradfitz
CC:
golang-dev
Visibility:
Public.
textproto: new field serialization routine

Patch Set 1 #

Patch Set 2 : diff -r 06e3a4c30dfb https://code.google.com/p/go/ #

Total comments: 3
Created: 13 years, 5 months ago
Download [raw] [tar.bz2]
Unified diffs Side-by-side diffs Delta from patch set Stats (+98 lines, -36 lines) Patch
M src/pkg/net/http/header.go View 1 2 chunks +2 lines, -21 lines 1 comment Download
M src/pkg/net/http/transfer.go View 1 1 chunk +10 lines, -15 lines 0 comments Download
M src/pkg/net/textproto/writer.go View 1 2 chunks +53 lines, -0 lines 2 comments Download
M src/pkg/net/textproto/writer_test.go View 1 2 chunks +33 lines, -0 lines 0 comments Download
Total messages: 8
|
pascal
Hello golang-dev@googlegroups.com (cc: golang-dev@googlegroups.com), I'd like you to review this change to https://code.google.com/p/go/
13 years, 5 months ago (2012年07月21日 12:55:06 UTC) #1
Hello golang-dev@googlegroups.com (cc: golang-dev@googlegroups.com),
I'd like you to review this change to
https://code.google.com/p/go/ 
Sign in to reply to this message.
adg
Does this fix any issues? What's the purpose of this change? http://codereview.appspot.com/6405072/diff/2001/src/pkg/net/textproto/writer.go File src/pkg/net/textproto/writer.go (right): ...
13 years, 5 months ago (2012年07月22日 22:31:41 UTC) #2
Does this fix any issues? What's the purpose of this change?
http://codereview.appspot.com/6405072/diff/2001/src/pkg/net/textproto/writer.go
File src/pkg/net/textproto/writer.go (right):
http://codereview.appspot.com/6405072/diff/2001/src/pkg/net/textproto/writer....
src/pkg/net/textproto/writer.go:15: const LongLineLength = 78
need these be exported constants? I don't think so
Sign in to reply to this message.
pascal
Hi Andrew, > Does this fix any issues? What's the purpose of this change? WriteMIMEField ...
13 years, 5 months ago (2012年07月23日 17:21:32 UTC) #3
Hi Andrew,
> Does this fix any issues? What's the purpose of this change?
WriteMIMEField adds folding functionality which can be used for writing HTTP 
and SMTP headers. I shared my patch because the resolved comment in 
transfer.go requested it explicitly:
	// TODO: At some point, there should be a generic mechanism for
	// writing long headers, using HTTP line splitting
> http://codereview.appspot.com/6405072/diff/2001/src/pkg/net/textproto/writer
> .go#newcode15 src/pkg/net/textproto/writer.go:15: const LongLineLength = 78
> need these be exported constants? I don't think so
Unlikely indeed.
Sign in to reply to this message.
bradfitz
http://codereview.appspot.com/6405072/diff/2001/src/pkg/net/textproto/writer.go File src/pkg/net/textproto/writer.go (right): http://codereview.appspot.com/6405072/diff/2001/src/pkg/net/textproto/writer.go#newcode131 src/pkg/net/textproto/writer.go:131: field := make([]byte, len(name)+len(body)+2) in the common case, this ...
13 years, 5 months ago (2012年07月30日 01:11:46 UTC) #4
http://codereview.appspot.com/6405072/diff/2001/src/pkg/net/textproto/writer.go
File src/pkg/net/textproto/writer.go (right):
http://codereview.appspot.com/6405072/diff/2001/src/pkg/net/textproto/writer....
src/pkg/net/textproto/writer.go:131: field := make([]byte,
len(name)+len(body)+2)
in the common case, this function shouldn't allocate any memory.
Sign in to reply to this message.
rsc
I'm a little skeptical that this is necessary, but it's definitely quite a bit more ...
13 years, 5 months ago (2012年07月30日 01:15:16 UTC) #5
I'm a little skeptical that this is necessary, but it's definitely quite a bit
more complex than it should be. If you can simplify it then we can look at
whether it pays for itself. Right now it doesn't.
Sign in to reply to this message.
pascal
Your concerns are well understood. After a forced Google account merge I can't submit changes ...
13 years, 5 months ago (2012年08月03日 13:49:21 UTC) #6
Your concerns are well understood. After a forced Google account merge I can't 
submit changes to this issue anymore. The attachment contains an update.
Sign in to reply to this message.
rsc
Please open a new CL if you want to continue working on this patch. You ...
13 years, 5 months ago (2012年08月03日 19:21:47 UTC) #7
Please open a new CL if you want to continue working on this patch.
You can rm $GOROOT/.hg/codereview/cl.6405072 and then run hg change to
make a new one as if this one had never existed.
I looked at the file, though, and it seems like it still allocates in
the common case. The current code uses WriteString explicitly to avoid
that problem.
I'd like to understand what this does to benchmarks (I think Brad has
one in the http package for this function) and I'd also like to
understand how important this really is. Are there commonly used
servers or clients that reject lines > 80 characters?
Russ
Sign in to reply to this message.
bradfitz
http://codereview.appspot.com/6405072/diff/2001/src/pkg/net/http/header.go File src/pkg/net/http/header.go (left): http://codereview.appspot.com/6405072/diff/2001/src/pkg/net/http/header.go#oldcode96 src/pkg/net/http/header.go:96: ws, ok := w.(writeStringer) all this writeStringer stuff was ...
13 years, 5 months ago (2012年08月07日 04:08:17 UTC) #8
http://codereview.appspot.com/6405072/diff/2001/src/pkg/net/http/header.go
File src/pkg/net/http/header.go (left):
http://codereview.appspot.com/6405072/diff/2001/src/pkg/net/http/header.go#ol...
src/pkg/net/http/header.go:96: ws, ok := w.(writeStringer)
all this writeStringer stuff was done for performance reasons. I'd hate to
throw that away for a corner case. If anything, only call
textproto.WriteMIMEField if len(v) > textproto.MaxFieldValueLength (const) or
something.
Sign in to reply to this message.
|
This is Rietveld f62528b

AltStyle によって変換されたページ (->オリジナル) /