Changeset 645

Show
Ignore:
Timestamp:
03/19/07 14:26:36 (17 months ago)
Author:
hyriand
Message:

Added initial (very hacky) version of a download socket. Museekd will now by
default try to download 'data' (which is my kernel) from my shares on slsk to
'download.out'.

Location:
branches/newnet/museekd/museekd
Files:
1 added
3 modified

Legend:

Unmodified
Added
Removed
  • branches/newnet/museekd/museekd/downloadmanager.cpp

    r634 r645  
    2222#include "peersocket.h" 
    2323#include "servermanager.h" 
     24#include "downloadsocket.h" 
    2425#include <NewNet/nnreactor.h> 
    2526 
     
    252253  { 
    253254    // Transfer can start immediately, no queue at remote end. 
    254     NNLOG("museek.debug", "Got transfer reply: user=%s,path=%s,ticket=%u,allowed=yes,filesize=%llu", user.c_str(), download->path.c_str(), download->ticket, message->filesize); 
    255     NNLOG("museek.debug", "Ehm.. We're supposed to do something here: connect to %s and claim our prize...", user.c_str()); 
     255    NNLOG("museek.debug", "Got transfer reply: user=%s,path=%s,ticket=%u,allowed=yes,filesize=%llu. Initiating download.", user.c_str(), download->path.c_str(), download->ticket, message->filesize); 
     256    download->size = message->filesize; 
     257    m_Museekd->reactor()->add(new DownloadSocket(m_Museekd, download)); 
    256258  } 
    257259  else 
  • branches/newnet/museekd/museekd/downloadmanager.h

    r634 r645  
    5050      uint ticket; // The download ticket with which this download is identified 
    5151      std::string user, path, localPath; 
     52      off_t size; 
    5253      TrState state; // Transfer state (see mutypes.h) 
    5354      std::string error; // Error message if state = TR_Error 
  • branches/newnet/museekd/museekd/main.cpp

    r643 r645  
    115115  museekd->reactor()->addTimeout(5000, new AutoConnectCallback); 
    116116 
     117  /* Add a sample download. */ 
     118  museekd->downloads()->add("hyriand", "\\home\\hyriand\\MyBook\\music\\data"); 
     119 
    117120  /* Start the reactor. This drives the daemon. */ 
    118121  museekd->reactor()->run();