 
 (defvar-local elfeed-curl--requests ()
   "List of URL / callback pairs for the current buffer.")
+
+(defvar-local elfeed-curl--refcount nil
+  "Number of callbacks waiting on the current buffer.")
 
 (defvar elfeed-curl--error-codes
   '((1 . "Unsupported protocol.")

          (setf elfeed-curl-error-message status))
        (cl-loop with handler = #'elfeed-curl--fail-callback
                 for (_ . cb) in elfeed-curl--requests
                 do (run-at-time 0 nil handler buffer cb)
                 finally (run-at-time 0 nil #'kill-buffer buffer))))))

(defun elfeed-curl-retrieve (url cb &optional headers)
  "Retrieve URL contents asynchronously, calling CB with one status argument.

            (progn
              (when (functionp cb)
                (setf cb (make-list (length url) cb)))
              (setf elfeed-curl--requests (cl-mapcar #'cons url cb)
                    elfeed-curl--refcount (length url)))
          (push (cons url cb) elfeed-curl--requests)
          (setf elfeed-curl--refcount 1))
        (setf (process-sentinel process) #'elfeed-curl--sentinel)))))

(defun elfeed-curl--request-key (url headers)
