Skip to content

Commit

Permalink
Remove select test call. Nothing prevent a socket from being closed
Browse files Browse the repository at this point in the history
while attached to a task anyway..
  • Loading branch information
toots committed Apr 10, 2013
1 parent 2fb5eb0 commit 4dd987c
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 22 deletions.
2 changes: 0 additions & 2 deletions CHANGES
Expand Up @@ -2,8 +2,6 @@
=====
* Remove Panic exception and let original exception bubble through.
* Removed win32 select work-around: patch applied upstream.
* Added dummy [select] calls before submitting a task to try to
protect against exceptions when calling actual [select]

0.4.2 (08-10-2011)
=====
Expand Down
20 changes: 0 additions & 20 deletions src/duppy.ml
Expand Up @@ -105,26 +105,6 @@ struct
let time () = Unix.gettimeofday ()

let rec t_of_task (task:('a,[<event])task) =
(** Test task sockets. There's no easy way to test
* sockets passed to [select] before hand for potential
* exception raised there. Once [select] raises an
* exception with multiple sockets passed, it is impossible
* to know which socket caused that exception, leading to
* fatal errors. Thus, we test each socket individually here
* using a [select] to stick to actual conditions. Please
* note that there is still a chance that the socket is closed
* between this test and the time it is actually pushed down
* to the main [select] call. *)
let prepare = function
| `Read socket ->
ignore(Unix.select [socket] [] [] 0.)
| `Write socket ->
ignore(Unix.select [] [socket] [] 0.)
| `Exception socket ->
ignore(Unix.select [] [] [socket] 0.)
| `Delay _ -> ()
in
List.iter prepare task.events;
let t0 = time () in
{ timestamp = t0 ; prio = task.priority ;
enrich = (fun e ->
Expand Down

0 comments on commit 4dd987c

Please sign in to comment.