- /* If we have active FTP session then give the packet directly to the
- protocol processor. */
- if (conn->internal->active_session) {
- /* Give it to the SFTP */
- if (conn->internal->active_session->server)
- silc_sftp_server_receive_process(conn->internal->active_session->sftp,
- sock, packet);
- else
- silc_sftp_client_receive_process(conn->internal->active_session->sftp,
- sock, packet);
- } else {
- /* We don't have active session, resolve the remote client information
- and then try to find the correct session. */
- SilcClientID *remote_id;
-
- if (packet->src_id_type != SILC_ID_CLIENT)
- return;
-
- remote_id = silc_id_str2id(packet->src_id, packet->src_id_len,
- SILC_ID_CLIENT);
- if (!remote_id)
- return;
-
- /* Resolve the client */
- silc_client_get_client_by_id_resolve(client, sock->user_data, remote_id,
- NULL, silc_client_ftp_resolve_cb,
- silc_packet_context_dup(packet));
- silc_free(remote_id);
- }