From: Rémi Bernon rbernon@codeweavers.com
--- server/protocol.def | 5 +++-- server/request.c | 3 +++ server/thread.h | 1 + 3 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/server/protocol.def b/server/protocol.def index 8966deeb78e..2dca787ea3a 100644 --- a/server/protocol.def +++ b/server/protocol.def @@ -57,8 +57,9 @@ struct request_header
struct reply_header { - unsigned int error; /* error result */ - data_size_t reply_size; /* reply variable part size */ + unsigned int error; /* error result */ + data_size_t reply_size : 30; /* reply variable part size */ + unsigned int fd_type : 2; /* replied inflight fd type if any */ };
enum fd_type diff --git a/server/request.c b/server/request.c index da941c9b59d..86b4338a5ad 100644 --- a/server/request.c +++ b/server/request.c @@ -296,6 +296,7 @@ static void call_req_handler( struct thread *thread )
current = thread; current->reply_size = 0; + current->reply_fd_type = FD_TYPE_NONE; clear_error(); memset( &reply, 0, sizeof(reply) );
@@ -312,6 +313,7 @@ static void call_req_handler( struct thread *thread ) { reply.reply_header.error = current->error; reply.reply_header.reply_size = current->reply_size; + reply.reply_header.fd_type = current->reply_fd_type; if (debug_level) trace_reply( req, &reply ); send_reply( &reply ); } @@ -526,6 +528,7 @@ int send_client_fd( struct process *process, enum fd_type type, int fd, obj_hand default: assert( 0 ); break; }
+ if (!ret && current && process == current->process) current->reply_fd_type = type; return ret; }
diff --git a/server/thread.h b/server/thread.h index 6a22fa85d02..b604b263489 100644 --- a/server/thread.h +++ b/server/thread.h @@ -70,6 +70,7 @@ struct thread unsigned int req_toread; /* amount of data still to read in request */ void *reply_data; /* variable-size data for reply */ unsigned int reply_size; /* size of reply data */ + unsigned int reply_fd_type; /* type of replied fd */ unsigned int reply_towrite; /* amount of data still to write in reply */ struct fd *request_fd; /* fd for receiving client requests */ struct fd *reply_fd; /* fd to send a reply to a client */