Made sleep_on usable from all requests.
diff --git a/server/request.c b/server/request.c
index 62b15e9..fa9ccc7 100644
--- a/server/request.c
+++ b/server/request.c
@@ -76,23 +76,13 @@
if (req < REQ_NB_REQUESTS)
{
req_handlers[req].handler( current->buffer, fd );
- if (current && current->state != SLEEPING) send_reply( current );
+ if (current && !current->wait) send_reply( current );
current = NULL;
return;
}
fatal_protocol_error( current, "bad request %d\n", req );
}
-/* handle a client timeout */
-void call_timeout_handler( void *thread )
-{
- current = (struct thread *)thread;
- if (debug_level) trace_timeout();
- clear_error();
- thread_timeout();
- current = NULL;
-}
-
/* set the fd to pass to the thread */
void set_reply_fd( struct thread *thread, int pass_fd )
{
@@ -103,7 +93,7 @@
/* send a reply to a thread */
void send_reply( struct thread *thread )
{
- if (thread->state == SLEEPING) thread->state = RUNNING;
+ assert( !thread->wait );
if (debug_level) trace_reply( thread );
if (!write_request( thread )) set_select_events( &thread->obj, POLLOUT );
}