Skip to content

Commit

Permalink
Reuse existing response buffers. Killing & popping to a new buffer wi…
Browse files Browse the repository at this point in the history
…ll obscure the request buffer after 2-3 requests.
  • Loading branch information
ieure committed Apr 25, 2011
1 parent bda8f45 commit 433e87c
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions http-twiddle.el
Expand Up @@ -84,8 +84,13 @@ occurences of \"$Content-Length\" are replaced with the actual content
length."
(interactive (http-twiddle-read-endpoint))
;; close any old connection
(when http-twiddle-process
(kill-buffer (process-buffer http-twiddle-process)))
(when (and http-twiddle-process
(buffer-live-p (process-buffer http-twiddle-process)))
(with-current-buffer (process-buffer http-twiddle-process)
(let ((inhibit-read-only t))
(widen)
(delete-region (point-min) (point-max)))))

(let ((content (buffer-string)))
(with-temp-buffer
(insert content)
Expand Down

0 comments on commit 433e87c

Please sign in to comment.