Index: uspace/lib/c/generic/async/server.c
===================================================================
--- uspace/lib/c/generic/async/server.c	(revision 62c4297bd1531e1b270184d67c9b55200e71d7df)
+++ uspace/lib/c/generic/async/server.c	(revision 1e472eea7d438ec6ce4974a09d063a281dce7532)
@@ -134,5 +134,4 @@
 	link_t link;
 
-	cap_call_handle_t chandle;
 	ipc_call_t call;
 } msg_t;
@@ -165,7 +164,4 @@
 	/** Messages that should be delivered to this fibril. */
 	list_t msg_queue;
-
-	/** Identification of the opening call. */
-	cap_call_handle_t chandle;
 
 	/** Call data of the opening call. */
@@ -413,5 +409,5 @@
 	client_t *client = async_client_get(fibril_connection->in_task_id, true);
 	if (!client) {
-		ipc_answer_0(fibril_connection->chandle, ENOMEM);
+		ipc_answer_0(fibril_connection->call.cap_handle, ENOMEM);
 		return 0;
 	}
@@ -422,5 +418,5 @@
 	 * Call the connection handler function.
 	 */
-	fibril_connection->handler(fibril_connection->chandle,
+	fibril_connection->handler(fibril_connection->call.cap_handle,
 	    &fibril_connection->call, fibril_connection->data);
 
@@ -449,5 +445,5 @@
 
 		list_remove(&msg->link);
-		ipc_answer_0(msg->chandle, EHANGUP);
+		ipc_answer_0(msg->call.cap_handle, EHANGUP);
 		free(msg);
 	}
@@ -472,9 +468,8 @@
  * @param in_task_id     Identification of the incoming connection.
  * @param in_phone_hash  Identification of the incoming connection.
- * @param chandle        Handle of the opening IPC_M_CONNECT_ME_TO call.
- *                       If chandle is CAP_NIL, the connection was opened by
- *                       accepting the IPC_M_CONNECT_TO_ME call and this
- *                       function is called directly by the server.
- * @param call           Call data of the opening call.
+ * @param call           Call data of the opening call. If call is NULL,
+ *                       the connection was opened by accepting the
+ *                       IPC_M_CONNECT_TO_ME call and this function is
+ *                       called directly by the server.
  * @param handler        Connection handler.
  * @param data           Client argument to pass to the connection handler.
@@ -484,11 +479,10 @@
  */
 static fid_t async_new_connection(task_id_t in_task_id, sysarg_t in_phone_hash,
-    cap_call_handle_t chandle, ipc_call_t *call, async_port_handler_t handler,
-    void *data)
+    ipc_call_t *call, async_port_handler_t handler, void *data)
 {
 	connection_t *conn = malloc(sizeof(*conn));
 	if (!conn) {
-		if (chandle != CAP_NIL)
-			ipc_answer_0(chandle, ENOMEM);
+		if (call)
+			ipc_answer_0(call->cap_handle, ENOMEM);
 
 		return (uintptr_t) NULL;
@@ -498,5 +492,4 @@
 	conn->in_phone_hash = in_phone_hash;
 	list_initialize(&conn->msg_queue);
-	conn->chandle = chandle;
 	conn->close_chandle = CAP_NIL;
 	conn->handler = handler;
@@ -505,4 +498,6 @@
 	if (call)
 		conn->call = *call;
+	else
+		conn->call.cap_handle = CAP_NIL;
 
 	/* We will activate the fibril ASAP */
@@ -513,6 +508,6 @@
 		free(conn);
 
-		if (chandle != CAP_NIL)
-			ipc_answer_0(chandle, ENOMEM);
+		if (call)
+			ipc_answer_0(call->cap_handle, ENOMEM);
 
 		return (uintptr_t) NULL;
@@ -569,5 +564,5 @@
 	sysarg_t phone_hash = IPC_GET_ARG5(answer);
 	fid_t fid = async_new_connection(answer.in_task_id, phone_hash,
-	    CAP_NIL, NULL, handler, data);
+	    NULL, handler, data);
 	if (fid == (uintptr_t) NULL)
 		return ENOMEM;
@@ -638,6 +633,5 @@
  * timeouts are unregistered.
  *
- * @param chandle  Handle of the incoming call.
- * @param call     Data of the incoming call.
+ * @param call Data of the incoming call.
  *
  * @return False if the call doesn't match any connection.
@@ -645,5 +639,5 @@
  *
  */
-static bool route_call(cap_call_handle_t chandle, ipc_call_t *call)
+static bool route_call(ipc_call_t *call)
 {
 	assert(call);
@@ -668,10 +662,9 @@
 	}
 
-	msg->chandle = chandle;
 	msg->call = *call;
 	list_append(&msg->link, &conn->msg_queue);
 
 	if (IPC_GET_IMETHOD(*call) == IPC_M_PHONE_HUNGUP)
-		conn->close_chandle = chandle;
+		conn->close_chandle = call->cap_handle;
 
 	/* If the connection fibril is waiting for an event, activate it */
@@ -1042,5 +1035,5 @@
 	list_remove(&msg->link);
 
-	cap_call_handle_t chandle = msg->chandle;
+	cap_call_handle_t chandle = msg->call.cap_handle;
 	*call = msg->call;
 	free(msg);
@@ -1089,9 +1082,8 @@
  * Otherwise the call is routed to its connection fibril.
  *
- * @param chandle  Handle of the incoming call.
- * @param call     Data of the incoming call.
- *
- */
-static void handle_call(cap_call_handle_t chandle, ipc_call_t *call)
+ * @param call Data of the incoming call.
+ *
+ */
+static void handle_call(ipc_call_t *call)
 {
 	assert(call);
@@ -1100,5 +1092,5 @@
 		return;
 
-	if (chandle == CAP_NIL) {
+	if (call->cap_handle == CAP_NIL) {
 		if (call->flags & IPC_CALL_NOTIF) {
 			/* Kernel notification */
@@ -1118,15 +1110,15 @@
 		    async_get_port_handler(iface, 0, &data);
 
-		async_new_connection(call->in_task_id, in_phone_hash, chandle,
-		    call, handler, data);
+		async_new_connection(call->in_task_id, in_phone_hash, call,
+		    handler, data);
 		return;
 	}
 
 	/* Try to route the call through the connection hash table */
-	if (route_call(chandle, call))
+	if (route_call(call))
 		return;
 
 	/* Unknown call from unknown phone - hang it up */
-	ipc_answer_0(chandle, EHANGUP);
+	ipc_answer_0(call->cap_handle, EHANGUP);
 }
 
@@ -1209,5 +1201,5 @@
 
 		assert(rc == EOK);
-		handle_call(call.cap_handle, &call);
+		handle_call(&call);
 	}
 
