fix #127 only trust the computed Content-Length header
fix NPE on stop_server #125