|
|
|
|
@ -269,7 +269,7 @@
|
|
|
|
|
#:transparent) |
|
|
|
|
(struct cmd-send-gc-answer (answer-pos) |
|
|
|
|
#:transparent) |
|
|
|
|
(struct cmd-send-gc-export (export-pos) |
|
|
|
|
(struct cmd-send-gc-export (export-pos wire-delta) |
|
|
|
|
#:transparent) |
|
|
|
|
|
|
|
|
|
;; utility for splitting up keyword argument hashtable in a way usable by |
|
|
|
|
@ -409,13 +409,7 @@
|
|
|
|
|
(define (increment-spare-imports-count! import-pos) |
|
|
|
|
(hash-set! spare-import-counts import-pos |
|
|
|
|
(add1 (hash-ref spare-import-counts import-pos 0)))) |
|
|
|
|
;; Go through all the "spare imports" and reset them |
|
|
|
|
(define (handle-spare-imports!) |
|
|
|
|
(for ([(import-pos count) (in-hash spare-import-counts)]) |
|
|
|
|
;; Send a gc-export message for this many |
|
|
|
|
(send-to-remote (op:gc-export import-pos count)) |
|
|
|
|
;; Reset these |
|
|
|
|
(hash-remove! spare-import-counts import-pos))) |
|
|
|
|
|
|
|
|
|
(define (decrement-exports-count-maybe-remove! export-pos delta) |
|
|
|
|
(-> integer? integer? any/c) |
|
|
|
|
(match (hash-ref export-counts export-pos #f) |
|
|
|
|
@ -470,7 +464,9 @@
|
|
|
|
|
(define (make-import-will-handler import-pos) |
|
|
|
|
(lambda _ |
|
|
|
|
(hash-remove! imports import-pos) |
|
|
|
|
(<-np-extern internal-handler (cmd-send-gc-export import-pos)))) |
|
|
|
|
(<-np-extern internal-handler |
|
|
|
|
(cmd-send-gc-export import-pos |
|
|
|
|
(add1 (hash-ref spare-import-counts import-pos 0)))))) |
|
|
|
|
(define (install-import-will-handler! refr import-pos) |
|
|
|
|
(will-register refr-will-executor refr |
|
|
|
|
(make-import-will-handler import-pos))) |
|
|
|
|
@ -717,14 +713,6 @@
|
|
|
|
|
[(keyword? arg) (values args (cons arg kw-args) kw-vals #t)] |
|
|
|
|
[else (values (cons arg args) kw-args kw-vals #f)]))) |
|
|
|
|
|
|
|
|
|
;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
|
|
|
|
;; TODO TODO TODO: EACH of these needs to call (handle-spare-imports!) |
|
|
|
|
;; at the end of its behavior! Probably the best thing to do is to |
|
|
|
|
;; make a wrapper for each of these that does so... and also which |
|
|
|
|
;; adds an error handler which aborts the whole thing if such an |
|
|
|
|
;; error occurs |
|
|
|
|
;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
|
|
|
|
|
|
|
|
|
(define ((^captp-incoming-handler bcom) msg) |
|
|
|
|
(unless running? |
|
|
|
|
(error 'captp-breakage "Captp session is no longer running but got ~a" |
|
|
|
|
@ -860,8 +848,8 @@
|
|
|
|
|
(send-to-remote listen-msg)] |
|
|
|
|
[(cmd-send-gc-answer (? integer? answer-pos)) |
|
|
|
|
(send-to-remote (op:gc-answer answer-pos))] |
|
|
|
|
[(cmd-send-gc-export (? integer? export-pos)) |
|
|
|
|
(send-to-remote (op:gc-export export-pos 1))])) |
|
|
|
|
[(cmd-send-gc-export (? integer? export-pos) (? integer? wire-delta)) |
|
|
|
|
(send-to-remote (op:gc-export export-pos wire-delta))])) |
|
|
|
|
(define (broken-handle-cmd cmd) |
|
|
|
|
(match cmd |
|
|
|
|
[(cmd-send-message msg) |
|
|
|
|
@ -877,7 +865,7 @@
|
|
|
|
|
(<-np listener-refr 'break (captp-session-severed))] |
|
|
|
|
[(cmd-send-gc-answer (? integer? answer-pos)) |
|
|
|
|
'no-op] |
|
|
|
|
[(cmd-send-gc-export (? integer? export-pos)) |
|
|
|
|
[(cmd-send-gc-export (? integer? export-pos) (? integer? wire-delta)) |
|
|
|
|
'no-op])) |
|
|
|
|
(if running? |
|
|
|
|
(running-handle-cmd cmd) |
|
|
|
|
|