-
Notifications
You must be signed in to change notification settings - Fork 109
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add utility function for generating Message-Id
- Loading branch information
Showing
4 changed files
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,8 @@ import ( | |
"net/textproto" | ||
"regexp" | ||
"strings" | ||
|
||
"log" | ||
) | ||
|
||
type headerField struct { | ||
|
@@ -260,6 +262,7 @@ func (h *Header) FieldsByKey(k string) HeaderFields { | |
func readLineSlice(r *bufio.Reader, line []byte) ([]byte, error) { | ||
for { | ||
l, more, err := r.ReadLine() | ||
log.Println("LINE", string(l), more) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
@@ -326,6 +329,7 @@ func hasContinuationLine(r *bufio.Reader) bool { | |
func readContinuedLineSlice(r *bufio.Reader) ([]byte, error) { | ||
// Read the first line. | ||
line, err := readLineSlice(r, nil) | ||
log.Println("HEY", string(line), err) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
@@ -338,6 +342,7 @@ func readContinuedLineSlice(r *bufio.Reader) ([]byte, error) { | |
|
||
// Read continuation lines. | ||
for hasContinuationLine(r) { | ||
log.Println("CONTINUATION") | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
emersion
Owner
|
||
line, err = readLineSlice(r, line) | ||
if err != nil { | ||
break // bufio will keep err until next read. | ||
|
Is it left here accidentally or what?