Skip to content

Commit

Permalink
Mq_stomp: fix write_stomp_frame (headers overwritten across msgs) (th…
Browse files Browse the repository at this point in the history
…x orbitz).
  • Loading branch information
mfp committed Jun 13, 2011
1 parent d4d31d8 commit 425ad7f
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions mq_stomp.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 425ad7f

Please sign in to comment.