Without that fix, Emacs interprets curl output as utf-8-dos and strips all \r .
It results in an error (search-failed "^\r\n"),
when moving from "100 Continue" to the next one in request--goto-next-body.
It's kind of strange behavior of Emacs,
since there is a single newline after the body:
Emacs recognizes which kind of end-of-line conversion to use based on the
contents of the file: if it sees only carriage returns, or only carriage return
followed by linefeed sequences, then it chooses the end-of-line conversion accordingly.
This behavior only manifests itself when body is a single long line.
Alternative solutions:
Use inhibit-eol-conversion somehow.
Change (set-process-coding-system proc encoding encoding) to
(set-process-coding-system proc 'no-conversion 'no-conversion) in request--curl.
For reference I stumbled on this bug, while using ycmd (company-ycmd).
Original error was
REQUEST [error] Error (error) while connecting to http://127.0.0.1:34353/completions.
deferred error : (wrong-type-argument number-or-marker-p nil)
Emacs 26.3, Ubuntu 18.04.1
Without that fix, Emacs interprets curl output as utf-8-dos and strips all \r . It results in an error
(search-failed "^\r\n")
, when moving from "100 Continue" to the next one inrequest--goto-next-body
.It's kind of strange behavior of Emacs, since there is a single newline after the body:
From the docs:
This behavior only manifests itself when body is a single long line.
Alternative solutions: Use
inhibit-eol-conversion
somehow. Change(set-process-coding-system proc encoding encoding)
to(set-process-coding-system proc 'no-conversion 'no-conversion)
inrequest--curl
.For reference I stumbled on this bug, while using ycmd (company-ycmd). Original error was