File tree Expand file tree Collapse file tree 1 file changed +8
-12
lines changed Expand file tree Collapse file tree 1 file changed +8
-12
lines changed Original file line number Diff line number Diff line change 10741074 (Thread/sleep 5 )
10751075 (s/put! s (encode-http-object response))))
10761076
1077- (defmacro with-tcp-server [handler & body]
1078- `(with-server (tcp/start-server ~handler {:port port
1079- :shutdown-timeout 0 })
1080- ~@body))
1081-
10821077(defmacro with-tcp-response [response & body]
1083- `(with-tcp-server (tcp-handler ~response) ~@body))
1078+ `(with-server (tcp/start-server (tcp-handler ~response) {:port port
1079+ :shutdown-timeout 0 })
1080+ ~@body))
10841081
10851082(defmacro with-tcp-request-handler [handler options request & body]
10861083 `(with-server (http/start-server ~handler (merge http-server-options ~options))
14461443(deftest test-in-flight-request-cancellation
14471444 (let [conn-established (promise )
14481445 conn-closed (promise )]
1449- (with-tcp-server (fn [s _]
1450- (deliver conn-established true )
1451- ; ; Required for the client close to be detected
1452- (s/consume identity s)
1453- (s/on-closed s (fn []
1454- (deliver conn-closed true ))))
1446+ (with-raw-handler (fn [req]
1447+ (deliver conn-established true )
1448+ (s/on-closed (:body req)
1449+ (fn []
1450+ (deliver conn-closed true ))))
14551451 (let [rsp (http-get " /" )]
14561452 (is (= true (deref conn-established 1000 :timeout )))
14571453 (http/cancel-request! rsp)
You can’t perform that action at this time.
0 commit comments