Browse Source
The HTTP RFCs require a server to fully consume the request body before it can return a non-error status code, which is any code below 400. JGit returns most Git level errors inside of an HTTP 200 OK response, and sometimes this happens before the entire request was consumed from the servlet container. In such cases the body must be skipped or read until EOF is reached, ensuring the HTTP keep-alive semantics will work for the next request on the same TCP connection. HTTP status codes >= 400 may be returned without consuming the body, and a servlet container must set "Connection: close" in the response headers when this happens, since the state of the request body is not well defined with an early abort. With the introduction of sendError() in GitSmartHttpTools there are only a handful of locations that need to worry about the request body being consumed, so sprinkle the call in as necessary. Change-Id: I5381e110585f780c01a764df8e27c80aacf5146estable-1.3
Shawn O. Pearce
13 years ago
4 changed files with 59 additions and 7 deletions
Loading…
Reference in new issue