+/**
+ * Handle request to sign a LOC URI (from client).
+ *
+ * @param cls closure (NULL)
+ * @param client identification of the client
+ * @param message the actual message
+ */
+static void
+handle_loc_sign (void *cls,
+ struct GNUNET_SERVER_Client *client,
+ const struct GNUNET_MessageHeader *message)
+{
+ const struct RequestLocSignatureMessage *msg;
+ struct GNUNET_FS_Uri base;
+ struct GNUNET_FS_Uri *loc;
+ struct ResponseLocSignatureMessage resp;
+ struct GSF_LocalClient *lc;
+
+ msg = (const struct RequestLocSignatureMessage *) message;
+ GNUNET_break (GNUNET_SIGNATURE_PURPOSE_PEER_PLACEMENT ==
+ ntohl (msg->purpose));
+ base.type = GNUNET_FS_URI_CHK;
+ base.data.chk.chk = msg->chk;
+ base.data.chk.file_length = GNUNET_ntohll (msg->file_length);
+ loc = GNUNET_FS_uri_loc_create (&base,
+ pk,
+ GNUNET_TIME_absolute_ntoh (msg->expiration_time));
+ resp.header.size = htons (sizeof (struct ResponseLocSignatureMessage));
+ resp.header.type = htons (GNUNET_MESSAGE_TYPE_FS_REQUEST_LOC_SIGNATURE);
+ resp.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_PEER_PLACEMENT);
+ resp.expiration_time = GNUNET_TIME_absolute_hton (loc->data.loc.expirationTime);
+ resp.signature = loc->data.loc.contentSignature;
+ resp.peer = loc->data.loc.peer;
+ GNUNET_FS_uri_destroy (loc);
+ lc = GSF_local_client_lookup_ (client);
+ GSF_local_client_transmit_ (lc,
+ &resp.header);
+ GNUNET_SERVER_receive_done (client, GNUNET_OK);
+}
+
+