1. james woodyatt
  2. oni

Commits

james woodyatt  committed ef09a44 Merge

Merge with latest 'default' branch.

  • Participants
  • Parent commits 63eb85a, 5347478
  • Branches sideline

Comments (0)

Files changed (3)

File etc/CHANGES

View file
 between released versions of the Oni libraries.
 
 
+==== Version 1.1 ===
+
++ Fixed an error in the Nx_socket module where the message flags on send and
+  recv calls would be passed incorrectly, with MSG_DONTWAIT applied.
+
+
 ==== Version 1.0 ===
 
 This release marks the repackaging of the separately distributed libraries in

File nx/nx_socket_p.c

View file
 }
 
 static const int nx_socket_msg_flags_array[] = {
-    MSG_OOB, MSG_PEEK, MSG_DONTROUTE, MSG_OOB, MSG_EOR, MSG_TRUNC,
-    MSG_CTRUNC, MSG_WAITALL, MSG_DONTWAIT
+    MSG_OOB, MSG_PEEK, MSG_DONTROUTE, MSG_EOR, MSG_TRUNC, MSG_CTRUNC,
+    MSG_WAITALL, MSG_DONTWAIT
 };
 
 #define Nx_socket_msg_flags_array_size \

File nx/t/t_nx.ml

View file
             let a, _ = listen#accept in
             let a = new Nx_tcp4_socket.endpoint a in
             let b = new Nx_tcp4_socket.endpoint (active#socket) in
-            a#setsockopt Nx_ip_common.tcp_nodelay true;
-            b#setsockopt Nx_ip_common.tcp_nodelay true;
             let laddr = a#getpeername and raddr = b#getsockname in
             let lhost, lport = laddr in
             let rhost, rport = raddr in
             let n = a#send tx 0 len in
             if n <> len then failwith "T2 error: tx incomplete!";
             a#shutdown Unix.SHUTDOWN_SEND;
-            let rc = ref true in
-            while !rc do (* this is to workaround a Mac OS X bug *)
-                try
-                    let n = b#recv rx 0 len in
-                    if n <> len then failwith "T2 error: rx incomplete!";
-                    rc := false
-                with
-                | Unix.Unix_error (Unix.EAGAIN, _, _) ->
-                    ()
-            done;
+            let n = b#recv rx 0 len in
             if n <> len then failwith "T2 error: rx incomplete!";
             if tx <> rx then failwith "T2 error: tx <> rx!";
             a#close;
             let a = new Nx_tcp6_socket.endpoint (active#socket) in
             let b, _ = listen#accept in
             let b = new Nx_tcp6_socket.endpoint b in
-            (*
-            a#setsockopt Nx_ip_common.tcp_nodelay true;
-            b#setsockopt Nx_ip_common.tcp_nodelay true;
-            *)
             let laddr = a#getpeername and raddr = b#getsockname in
             let lhost, lport, lscope = laddr in
             let rhost, rport, rscope = raddr in
             let n = a#send tx 0 len in
             if n <> len then failwith "T3 error: tx incomplete!";
             a#shutdown Unix.SHUTDOWN_SEND;
-            let rc = ref true in
-            while !rc do (* this is to workaround a Mac OS X bug *)
-                try
-                    let n = b#recv rx 0 len in
-                    if n <> len then failwith "T3 error: rx incomplete!";
-                    rc := false
-                with
-                | Unix.Unix_error (Unix.EAGAIN, _, _) ->
-                    ()
-            done;
+            let n = b#recv rx 0 len in
+            if n <> len then failwith "T3 error: rx incomplete!";
             if tx <> rx then failwith "T3 error: tx <> rx!";
             a#close;
             b#close;
 end
 
 let main () =
-    let tests = [
-        T1.test; T2.test; T3.test; T4.test;
-    ] in
+    let tests = [ T1.test; T2.test; T3.test; T4.test ] in
     Printf.printf "1..%d\n" (List.length tests);
     flush stdout;