Skip to content
Browse files

Mq_stomp: fix write_stomp_frame (headers overwritten across msgs) (th…

…x orbitz).
  • Loading branch information...
1 parent d4d31d8 commit 425ad7ff326cdfe15dd45cd1119c8deaf147ab18 @mfp committed Jun 13, 2011
Showing with 9 additions and 8 deletions.
  1. +9 −8 mq_stomp.ml
View
17 mq_stomp.ml
@@ -47,14 +47,15 @@ let write_stomp_frame ~eol och frame =
Buffer.add_string b (string_of_int (String.length frame.fr_body));
Buffer.add_char b '\n';
Buffer.add_char b '\n';
- Lwt_io.atomic
- (fun och ->
- Lwt_io.write och (Buffer.contents b) >>
- Lwt_io.write och frame.fr_body >>
- (if eol then Lwt_io.write och "\000\n"
- else Lwt_io.write och "\000") >>
- Lwt_io.flush och)
- och
+ let headers = Buffer.contents b in
+ Lwt_io.atomic
+ (fun och ->
+ Lwt_io.write och headers >>
+ Lwt_io.write och frame.fr_body >>
+ (if eol then Lwt_io.write och "\000\n"
+ else Lwt_io.write och "\000") >>
+ Lwt_io.flush och)
+ och
let handle_receipt ?(extra_headers=[]) ~eol och frame =
try

0 comments on commit 425ad7f

Please sign in to comment.
Something went wrong with that request. Please try again.