                                 next-based-on-eof))
         ;; Lines 293-296
         rtt-resend-time (+ earliest-time rtt-timeout)
+        ;; In the reference implementation, 0 for a block's time
+        ;; means it's been ACK'd.
+        ;; => if earliest-time for all blocks is 0, they've all been
+        ;; ACK'd.
+        ;; This is another place where I'm botching that.
+        ;; I've started relying on a ::ackd? flag in each block
+        ;; instead.
+        ;; But calculating earliest-time based on that isn't working
+        ;; the way I expect/want.
         next-based-on-earliest-block-time (if (and (not= 0 earliest-time)
                                                    (> rtt-resend-time
                                                       min-resend-time))

;;;                 Evidence:
;;;        606: /* XXX: incorporate selective acknowledgents */ (DJB)

;;;  634-643: try closing pipe to child: (DJB)
;;;           Well, maybe. If we're done with it

(defn choose-next-scheduled-time
  [{{:keys [::specs/n-sec-per-block

                                based-on-closed-child))
        ;; Lines 302-305
        actual-next (max based-on-closed-child recent)
        mid-time (System/nanoTime)
        alt (cond-> default-next
              (= want-ping ::specs/second-1) (do (+ recent (utils/seconds->nanos 1)))
              (= want-ping ::specs/immediate) (min min-resend-time)
              ;; If the outgoing buffer is not full
              ;; And:
              ;;   If sendeof, but not sendeofprocessed
              ;;   else (!sendeof):
              ;;     if there are buffered bytes that have not been sent yet
              (let [un-ackd-count (count un-ackd-blocks)
                    un-sent-count(count un-sent-blocks)]
                (and (< (+ un-ackd-count
                           un-sent-count)
                        K/max-outgoing-blocks)
                     (if send-eof
                       (not send-eof-processed)
                       (< 0 un-sent-count)))) (min min-resend-time)
              (and (not= 0 earliest-time)
                   (>= rtt-resend-time min-resend-time)) (min rtt-resend-time))
        end-time (System/nanoTime)]
    (log/debug (utils/pre-log message-loop-name)
               (cl-format nil "Calculating next scheduled time took ~:d nanoseconds and calculated ~:d. Alt approach took ~:d and calculated ~:d"
                          (- mid-time now)
                          actual-next
                          (- end-time mid-time)
                          alt))
    actual-next))

;;; I really want to move schedule-next-timeout to flow-control.
