Skip to content

Commit

Permalink
Revert "Fix line delimited JSON response"
Browse files Browse the repository at this point in the history
This reverts commit d2f75a3.

Conflicts:
	integration-cli/docker_api_events_test.go

Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <[email protected]> (github: jfrazelle)
  • Loading branch information
jessfraz committed Oct 9, 2014
1 parent 4c6b7cd commit b66ac6a
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 65 deletions.
2 changes: 1 addition & 1 deletion api/client/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ func (cli *DockerCli) streamHelper(method, path string, setRawTerminal bool, in
}

if api.MatchesContentType(resp.Header.Get("Content-Type"), "application/json") {
return utils.DisplayJSONMessagesStream(resp.Body, stdout, cli.terminalFd, cli.isTerminal)
return utils.DisplayJSONMessagesStream(resp.Body, stdout, cli.outFd, cli.isTerminalOut)
}
if stdout != nil || stderr != nil {
// When TTY is ON, use regular copy
Expand Down
2 changes: 0 additions & 2 deletions api/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -297,8 +297,6 @@ func getEvents(eng *engine.Engine, version version.Version, w http.ResponseWrite
}

var job = eng.Job("events")
// lineDelimited JSON events was added #7047
job.SetenvBool("lineDelim", version.GreaterThanOrEqualTo("1.15"))
streamJSON(job, w, true)
job.Setenv("since", r.Form.Get("since"))
job.Setenv("until", r.Form.Get("until"))
Expand Down
5 changes: 0 additions & 5 deletions events/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,6 @@ func writeEvent(job *engine.Job, event *utils.JSONMessage) error {
// When sending an event JSON serialization errors are ignored, but all
// other errors lead to the eviction of the listener.
if b, err := json.Marshal(event); err == nil {

if job.GetenvBool("lineDelim") {
b = append(b, []byte("\r\n")...)
}

if _, err = job.Stdout.Write(b); err != nil {
return err
}
Expand Down
57 changes: 0 additions & 57 deletions integration-cli/docker_api_events_test.go

This file was deleted.

0 comments on commit b66ac6a

Please sign in to comment.