wiki:HowSoulseekWorks

How Soulseek Works

This document should explain how Soulseek messages are recieved, proccessed and responded to in Museekd.

Downloading a Folder

Downloading a directory via Search issues as FolderContentsRequest? (36) message, which asks the remote client to examine the directory you requested, and send to you a FolderContentsResponse? (37) containing the files in that directory. You then read that message and queue the files.

Downloading a directory via Browse Shares parses the shares database and selects all the files in the directory (and possibly the subdirectories) a directly queue the files.

Transfer Requests

  • Museekd Recieved a Transfer Request
  • Parse it to know the username, direction, ticket, filename and -- if it's a download -- the filesize.

Upload

FAILURES:

  1. If the username is mine, Abort transfer and send an Upload Reply about not being able to transfer to yourself.
  2. If the username is banned, send an Upload Reply about being 'banned or sharing list only'
  3. If the file is NOT in the buddy shares and you ENABLED buddy shares and the username is buddied then send an Upload Reply about the file 'not being shared'
  4. If the file IS in the buddy shares and buddy shares are ENABLED and the username is not buddied and the file is not in NORMAL shares then send an Upload Reply about the file 'not being shared'
  5. If the file is NOT in the NORMAL shares and NOT in the BUDDY shares send an Upload Reply about the file 'not being shared'

NO BAD MATCHES:

  1. If none of the above are true check if there is an open upload slot. If there is, try to start uploading, if there isn't queue the file.

Download

  1. If the username is mine, Abort transfer and send an Download Reply about not being able to transfer to yourself.
  2. Look for a previously initated download transfer with this user and path
  3. If the download hasn't been initiated, yet and the user isn't a trusted user abort it. If the user is trusted, create a new download.
  4. If the download has been initiated, start downloading, otherwise send a 'Canceled' message.
Last modified 11 years ago Last modified on 27/09/2006 18:55:44