Skip to content

Commit

Permalink
Mq_stomp_client.receive_receipt: ignore receipt in case of error.
Browse files Browse the repository at this point in the history
  • Loading branch information
mfp committed Dec 13, 2009
1 parent 9f33267 commit e04f223
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 4 additions & 1 deletion mq_stomp_client.ml
Original file line number Diff line number Diff line change
Expand Up @@ -323,5 +323,8 @@ struct
let r = Hashtbl.find conn.c_pending_receipts rid in
Hashtbl.remove conn.c_pending_receipts rid;
return r
with Not_found -> get_receipt "receive_receipt" conn rid
with Not_found ->
catch
(fun () -> get_receipt "receive_receipt" conn rid)
(fun e -> Hashtbl.remove conn.c_pending_receipts rid; raise e)
end
3 changes: 2 additions & 1 deletion mq_stomp_client.mli
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ sig
(** [receive_receipt conn rid] blocks until a RECEIPT with the given
* receipt-id is received. You must use [expect_receipt] before, or the
* RECEIPT might be discarded (resulting in receive_receipt blocking
* forever). *)
* forever). If an error occurs, the RECEIPT will be discarded if received
* at any later point in time. (This is meant to prevent memleaks.) *)
val receive_receipt : connection -> string -> receipt thread

(** Return a unique receipt id. *)
Expand Down

0 comments on commit e04f223

Please sign in to comment.