Permalink
Browse files

Cleaned up debug messages.

  • Loading branch information...
1 parent c8c060c commit f60a16ec41b81828b04ebd5fa388e47127391939 @samuelaustin samuelaustin committed Jun 26, 2012
Showing with 5 additions and 17 deletions.
  1. +0 −3 server/src/Download.cpp
  2. +1 −11 server/src/DownloadManager.cpp
  3. +4 −2 server/src/HttpServer.cpp
  4. +0 −1 server/test/testsuite/DownloadTest.cpp
View
@@ -52,8 +52,6 @@ void Download::start() {
swift::Address trackeraddr = swift::Address(getTrackerAddress().c_str());
swift::Sha1Hash roothash = swift::Sha1Hash(true, getRootHash().c_str());
- std::cout << "Filename = " << getFilename() << std::endl;
-
if (getID() < 0) {
// Open the file with swift.
int id = swift::Open(getFilename().c_str(), roothash, trackeraddr);
@@ -65,7 +63,6 @@ void Download::start() {
std::cout << "TRANSFER IS NULL" << std::endl;
}
pthread_mutex_unlock(&_transfer_mutex);
- std::cout << "ID = " << getID() << std::endl;
}
/**
@@ -71,7 +71,6 @@ Download DownloadManager::getActiveDownload() {
* Updates the download statistics.
*/
void DownloadManager::updateDownloadStatistics() {
- std::cout << "Entered" << std::endl;
pthread_mutex_lock(&mutex);
pthread_mutex_lock(&active_download_mutex);
@@ -421,15 +420,13 @@ void downloadCallback(int fd, short event, void* arg) {
*/
void *DownloadManager::dispatch(void* arg) {
// Assign callbacks to the event base.
- std::cout << "Entered thread." << std::endl;
evtimer_assign(&evcompl, swift::Channel::evbase, downloadCallback, NULL);
evtimer_add(&evcompl, swift::tint2tv(TINT_SEC));
// Dispatch the event base to enter the swift loop.
- std::cout << "Now dispatching event base." << std::endl;
event_base_dispatch(swift::Channel::evbase);
- std::cout << "Download ID: " << active_download->getID() << std::endl;
+ std::cout << "Dispatched event base." << std::endl;
pthread_exit(NULL);
}
@@ -438,9 +435,7 @@ void *DownloadManager::dispatch(void* arg) {
* @param download_hash: The root hash of the download.
*/
void DownloadManager::pauseDownload(const std::string download_hash) {
- std::cout << "pausing" << std::endl;
int index = getIndexFromHash(download_hash);
- std::cout << "Index = " << index << std::endl;
if (index >= 0) {
pthread_mutex_lock(&mutex);
@@ -502,7 +497,6 @@ int DownloadManager::resumeDownload(std::string download_hash) {
*/
int DownloadManager::startDownload(const std::string download_hash) {
int index = getIndexFromHash(download_hash);
- std::cout << "Index = " << index << std::endl;
if (index >= 0) {
pthread_mutex_lock(&mutex);
@@ -593,10 +587,6 @@ void DownloadManager::add(Download *download) {
pthread_mutex_unlock(&mutex);
if (active_download) {
- pthread_mutex_lock(&active_download_mutex);
- std::cout << "Active Index is: " << getIndexFromHash(active_download->getRootHash()) << std::endl;
- pthread_mutex_unlock(&active_download_mutex);
-
pthread_mutex_lock(&mutex);
setActiveDownload(&downloads.at(active_index));
pthread_mutex_unlock(&mutex);
@@ -24,7 +24,7 @@ static void HttpServer::sendXMLResponse(std::string msg, struct evhttp_request *
// Send the final message.
evhttp_send_reply(req, 200, "OK", buf);
- std::cout << "Sent the message." << std::endl;
+ std::cout << "Sent the response." << std::endl;
}
/**
@@ -42,7 +42,7 @@ static void HttpServer::sendResponse(struct evhttp_request *req, struct evbuffer
// Send the final message.
evhttp_send_reply(req, 200, "OK", buf);
- std::cout << "Sent the message." << std::endl;
+ std::cout << "Sent the response." << std::endl;
}
/**
@@ -56,6 +56,7 @@ static void HttpServer::handleRequest(struct evhttp_request *req, void *arg) {
struct evbuffer *evb;
struct evhttp_uri *decoded;
+ std::cout << "---------------------" << std::endl;
std::cout << "Got a GET request for " << uri << std::endl;
// Decode the URI.
@@ -183,6 +184,7 @@ static void HttpServer::handleRequest(struct evhttp_request *req, void *arg) {
evbuffer_free(evb);
std::cout << "Cleaned evb garbage" << std::endl;
}
+ std::cout << "---------------------" << std::endl;
}
/**
@@ -31,7 +31,6 @@ class DownloadTest : public ::testing::Test {
std::cout << "Failed opening Downloads directory in DownloadTest" << std::endl;
} else {
- std::cout << "TEST: Removing all files in " << Settings::getDownloadDirectory() << std::endl;
while ((dirp = readdir(dp)) != NULL) {
std::string filename(dirp->d_name);
if (filename.at(0) != '.') {

0 comments on commit f60a16e

Please sign in to comment.