aria2/src/message.h

74 lines
3.8 KiB
C
Raw Normal View History

2006-02-17 13:35:04 +00:00
/* <!-- copyright */
/*
* aria2 - a simple utility for downloading files faster
*
* Copyright (C) 2006 Tatsuhiro Tsujikawa
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* copyright --> */
#ifndef _D_MESSAGE_H_
#define _D_MESSAGE_H_
#include "common.h"
#define MSG_DOWNLOAD_COMPLETED _("CUID#%d - The download for one segment completed successfully.")
#define MSG_NO_SEGMENT_AVAILABLE _("CUID#%d - No segment available.")
#define MSG_CONNECTING_TO_SERVER _("CUID#%d - Connecting to %s:%d")
#define MSG_SEGMENT_CHANGED _("CUID#%d - The segment changed. We send the request again with new Range header.")
#define MSG_REDIRECT _("CUID#%d - Redirecting to %s")
#define MSG_SENDING_REQUEST _("CUID#%d - Requesting:\n%s")
#define MSG_RECEIVE_RESPONSE _("CUID#%d - Response received:\n%s")
#define MSG_DOWNLOAD_ABORTED _("CUID#%d - Download aborted.")
#define MSG_RESTARTING_DOWNLOAD _("CUID#%d - Restarting the download.")
#define MSG_MAX_TRY _("CUID#%d - %d times attempted, but no success. Download aborted.")
#define MSG_UNREGISTER_CUID _("CUID#%d - Unregistering cuid from segmentManager.")
2006-03-21 14:12:51 +00:00
#define MSG_SEND_PEER_MESSAGE "CUID#%d - To: %s:%d %s"
#define MSG_SEND_PEER_MESSAGE_WITH_INDEX "CUID#%d - To: %s:%d %s index=%d"
#define MSG_SEND_PEER_MESSAGE_WITH_BITFIELD "CUID#%d - To: %s:%d %s %s"
#define MSG_SEND_PEER_MESSAGE_WITH_INDEX_BEGIN_LENGTH "CUID#%d - To: %s:%d %s index=%d, begin=%d, length=%d"
#define MSG_RECEIVE_PEER_MESSAGE "CUID#%d - From: %s:%d %s"
#define MSG_GOT_NEW_PIECE "CUID#%d - we got new piece. index=%d"
#define MSG_GOT_WRONG_PIECE "CUID#%d - we got wrong piece. index=%d"
2006-04-19 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com> To add a readout of estimated remaining time to normal HTTP/FTP downloads: * src/ConsoleDownloadEngine.h (startup): New variable. (startupLength): New variable. (isStartupLengthSet): New variable. (avgSpeed): New variable. (eta): New variable. * src/ConsoleDownloadEngine.cc (sendStatistics): Added a readout of estimated remaining time. (initStatistics): Initialized newly added variables. (calculateStatistics): Calculate average speed and estimated remaining time. To decouple TorrentDownloadEngine from HttpResponseCommand: * src/TrackerDownloadCommand.h: Removed. * src/TrackerDownloadCommand.cc: Removed. * src/TrackerInitCommand.h: Removed. * src/TrackerInitCommand.cc: Removed. * src/TrackerUpdateCommand.h: Removed. * src/TrackerUpdateCommand.cc: Removed. * src/TrackerWatcherCommand.cc (execute): The construction of request url written in TrackerInitCommand was moved here. Do not create tracker request command if torretnMan->trackers != 0. * src/CompactTrackerResponseProcessor.h: New class. * src/CompactTrackerResponseProcessor.cc: New class. * src/message.h (MSG_TRACKER_WARNING_MESSAGE): Updated. * src/HttpResponseCommand.cc (createHttpDownloadCommand): Decoupled TorrentDownloadEngine from this. * src/SegmentMan.h (init): New function. * src/SegmentMan.cc (init): New function. * src/TorrentMan.h (responseProcessor): New variable. (trackers): New variable. (setTrackerResponseProcessor): New function. (getTrackerResponseProcessor): New function. (processTrackerResponse): New function. * src/TorrentMan.cc (Constructor): Initialized new variable trackers. (processTrackerResponse): New function. * src/main.cc (main): Use ByteArrayDiskWriter and CompactTrackerResponseProcessor. * src/TorrentDownloadEngine.cc (afterEachIteration): Call torrentMan-> processTrackerResponse(). * src/TorrentConsoleDownloadEngine.cc (printStatistics): Updated a readout. * src/TorrentDownloadEngine.cc (afterEachIteration): Added log message which indicates download has completed. * src/AbstractDiskWriter.cc (Destructor): fd >= 0, not fd >0 (closeFile): fd >= 0, not fd > 0 * src/main.cc (main): Added short cut for show-files. Added short cut for torrent-file. Added new command-line option listen-port. Updated i18n messages.
2006-04-18 17:06:17 +00:00
#define MSG_TRACKER_WARNING_MESSAGE "Tracker returned warning message: %s"
2006-02-17 13:35:04 +00:00
#define MSG_SEGMENT_FILE_EXISTS _("The segment file %s exists.")
#define MSG_SEGMENT_FILE_DOES_NOT_EXIST _("The segment file %s does not exist.")
#define MSG_SAVING_SEGMENT_FILE _("Saving the segment file %s")
#define MSG_SAVED_SEGMENT_FILE _("The segment file was saved successfully.")
#define MSG_LOADING_SEGMENT_FILE _("Loading the segment file %s.")
#define MSG_LOADED_SEGMENT_FILE _("The segment file was loaded successfully.")
2006-02-17 13:35:04 +00:00
#define EX_TIME_OUT _("Timeout.")
#define EX_INVALID_CHUNK_SIZE _("Invalid chunk size.")
#define EX_TOO_LARGE_CHUNK _("Too large chunk. size = %d")
#define EX_INVALID_HEADER _("Invalid header.")
#define EX_INVALID_RESPONSE _("Invalid response.")
#define EX_NO_HEADER _("No header found.")
#define EX_NO_STATUS_HEADER _("No status header.")
#define EX_PROXY_CONNECTION_FAILED _("Proxy connection failed.")
#define EX_CONNECTION_FAILED _("Connection failed.")
#define EX_FILENAME_MISMATCH _("The requested filename and the previously registered one are not same. %s != %s")
#define EX_BAD_STATUS _("The response status is not successful. status = %d")
#define EX_TOO_LARGE_FILE _("Too large file size. size = %lld")
#define EX_TRANSFER_ENCODING_NOT_SUPPORTED _("Transfer encoding %s is not supported.")
#define EX_SSL_INIT_FAILURE _("SSL initialization failed.")
#define EX_SIZE_MISMATCH _("Size mismatch %lld != %lld")
2006-03-05 06:32:01 +00:00
#define EX_GOT_EOF _("Got EOF from the server.")
2006-03-21 14:12:51 +00:00
#define EX_EOF_FROM_PEER "Got EOF from peer."
#define EX_MULFORMED_META_INFO "Mulformed meta info."
2006-02-17 13:35:04 +00:00
#endif // _D_MESSAGE_H_