aria2/src/message.h

120 lines
7.0 KiB
C
Raw Normal View History

2006-02-17 13:35:04 +00:00
/* <!-- copyright */
/*
* aria2 - The high speed download utility
2006-02-17 13:35:04 +00:00
*
* 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* In addition, as a special exception, the copyright holders give
* permission to link the code of portions of this program with the
* OpenSSL library under certain conditions as described in each
* individual source file, and distribute linked combinations
* including the two.
* You must obey the GNU General Public License in all respects
* for all of the code used other than OpenSSL. If you modify
* file(s) with this exception, you may extend this exception to your
* version of the file(s), but you are not obligated to do so. If you
* do not wish to do so, delete this exception statement from your
* version. If you delete this exception statement from all source
* files in the program, then also delete it here.
2006-02-17 13:35:04 +00:00
*/
/* 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-03-21 14:12:51 +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.")
#define MSG_NO_URL_TO_DOWNLOAD _("No URI to download. Download aborted.")
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")
#define EX_AUTH_FAILED _("Authorization failed.")
2006-03-05 06:32:01 +00:00
#define EX_GOT_EOF _("Got EOF from the server.")
#define EX_EOF_FROM_PEER _("Got EOF from peer.")
#define EX_MULFORMED_META_INFO _("Malformed meta info.")
To add TrackerUpdateCommand with which replaces CompactTrackerResponseProcessor: * src/TrackerWatcherCommand.h (req): Removed. * src/TrackerWatcherCommand.cc (execute): Send a request to tracker if the number of peer connections are less than 30. * src/ByteArrayDiskWriter.h (readData): Implemented. * src/SegmentMan.h (diskWriter): New function. * src/SegmentMan.cc (init): Added a call to diskWriter->closeFile() * src/main.cc : Removed #include "CompactTrackerResponseProcessor.h" (main): Use TrackerUpdateCommand. * src/TorrentMan.h (CompactTrackerResponseProcessor): Removed. (req): New variable. (setTrackerResponseProcessor): Removed. (getTrackerResponseProcessor): Removed. (processTrackerResponse): Removed. * src/DownloadEngine.h (diskWriter): Removed. * src/TorrentDownloadEngine.cc (afterEachIteration): Removed a call to torrentMan->processTrackerResponse(). To add Util::expandBuffer: * src/ByteArrayDiskWriter.h (expandBuffer): Removed. * src/ByteArrayDiskWriter.cc (writeData): Use Util::expandBuffer(). * src/Util.h (expandBuffer): New function. To fix the bug that causes segmentation fault when "-l ." is specified in command-line option: * src/SimpleLogger.h (SimpleLogger): Removed "filename" argument. (openFile): New function. (closeFile): New function. * src/SimpleLogger.cc (SimpleLogger): Removed fopen. (~SimpleLogger): Call closeFile(); * src/LogFactory.cc (getInstance): Added a call to slogger->openFile(). * src/main.cc (main): Added a check to see logger is configured properly. To enable HTTP authentication without specifying "--http-auth-scheme" * src/prefs.h (PREF_HTTP_AUTH_ENABLED): New definition. * src/HttpConnection.cc (createRequest): Send Authorization header if PREF_HTTP_AUTH_ENABLED == V_TRUE. * src/main.cc (main): Preset PREF_HTTP_AUTH_SCHEME to V_TRUE If "--http-user" is specified, set PREF_HTTP_AUTH_ENABLED to V_TRUE * src/Peer.cc (shouldChoke): Updated algorithm. * src/message.h (EX_AUTH_FAILED): New definition. (EX_FILE_OPEN): New definition. * src/HttpResponseCommand.cc (checkResponse): Throw DlAbortEx if status == 401. (handleDefaultEncoding): Added a call to diskWriter->initAndOpenFile() if req->isTorrent == true. * src/main.cc (handler): Removed the check to see e->diskWriter != NULL (torrentHandler): Removed the check to see diskAdaptor != NULL. * src/AbstractDiskWriter.cc (openExistingFile): Updated messsage. (createFile): Updated message.
2006-04-19 17:23:58 +00:00
#define EX_FILE_OPEN _("Failed to open the file %s, cause: %s")
#define EX_FILE_WRITE _("Failed to write into the file %s, cause: %s")
#define EX_FILE_READ _("Failed to read from the file %s, cause: %s")
#define EX_FILE_SHA1SUM _("Failed to calculate SHA1 digest of or a part of the file %s, cause: %s")
#define EX_FILE_SEEK _("Failed to seek the file %s, cause: %s")
#define EX_FILE_OFFSET_OUT_OF_RANGE _("The offset is out of range, offset=%lld")
#define EX_NOT_DIRECTORY _("%s is not a directory.")
#define EX_MAKE_DIR _("Failed to make the directory %s, cause: %s")
#define EX_SEGMENT_FILE_OPEN _("Failed to open the segment file %s, cause: %s")
#define EX_SEGMENT_FILE_WRITE _("Failed to write into the segment file %s, cause: %s")
#define EX_SEGMENT_FILE_READ _("Failed to read from the segment file %s, cause: %s")
#define EX_SOCKET_OPEN _("Failed to open a socket, cause: %s")
#define EX_SOCKET_SET_OPT _("Failed to set a socket option, cause: %s")
#define EX_SOCKET_BIND _("Failed to bind a socket, cause: %s")
#define EX_SOCKET_LISTEN _("Failed to listen to a socket, cause: %s")
#define EX_SOCKET_ACCEPT _("Failed to accept a peer connection, cause: %s")
#define EX_SOCKET_GET_NAME _("Failed to get the name of socket, cause: %s")
#define EX_SOCKET_GET_PEER _("Failed to get the name of connected peer, cause: %s")
#define EX_RESOLVE_HOSTNAME _("Failed to resolve the hostname %s, cause: %s")
#define EX_SOCKET_CONNECT _("Failed to connect to the host %s, cause: %s")
#define EX_SOCKET_CHECK_WRITABLE _("Failed to check whether the socket is writable, cause: %s")
#define EX_SOCKET_CHECK_READABLE _("Failed to check whether the socket is readable, cause: %s")
#define EX_SOCKET_SEND _("Failed to send data, cause: %s")
#define EX_SOCKET_RECV _("Failed to receive data, cause: %s")
#define EX_SOCKET_PEEK _("Failed to peek data, cause: %s")
2007-01-28 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com> * src/Xml2MetalinkProcessor.h (xpathExists): New function. * src/Xml2MetalinkProcessor.cc (xpathExists): New function. Not to send HEAD request if filename and size are available in Metalink file: * src/UrlRequestInfo.h (filename): New variable. (totalLength): New variable. (setTotalLength): New function. (setFilename): New function. * src/MetalinkRequestInfo.cc (execute): Set filename and size to UrlRequestInfo. * src/MetalinkEntry.cc (MetalinkEntry): Initialize size with 0. * src/UrlRequestInfo.cc (execute): Set filename and size to SegmentMan. Not to download rest of the files after selected files are downloaded in BitTorrent: * src/PieceStorage.h (allDownloadFinished): New function. * src/DefaultBtAnnounce.cc (isCompleteAnnounceReady): Use allDownloadFinished instead of downloadFinished. (getAnnounceUrl): Use allDownloadFinished instead of downloadFinished. * src/DefaultPieceStorage.cc (completePiece): Use allDownloadFinished instead of downloadFinished. Commented out the call to finishSelectiveDownloadingMode(). (downloadFinished): Call isFilteredAllBitSet() instead of isAllBitSet(). (allDownloadFinished): New function. * src/DefaultBtInteractive.cc (addBitfieldMessageToQueue): Call allDownloadFinished() instead of downloadFinished(). (checkHave): Call allDownloadFinished() instead of downloadFinished(). * src/TorrentDownloadEngine.cc (onEndOfRun): Call allDownloadFinished() instead of downloadFinished(). * src/BitfieldMan.h (isFilteredAllBitSet): New function. * src/ShareRatioSeedCriteria.h (PieceStorage.h): New include. (pieceStorage): New variable. (evaluate): btContext->getTotalLength() -> pieceStorage->getCompletedLength() * src/BitfieldMan.cc (isFilteredAllBitSet): New function. (isAllBitSet): Filter is not took into account. Rename --force-truncate as --allow-overwrite: * src/TorrentRequestInfo.cc (execute): PREF_FORCE_TRUNCATE -> PREF_ALLOW_OVERWRITE * src/main.cc (showUsage): --force-truncate -> --allow-overwrite * src/message.h (EX_FILE_ALREADY_EXISTS): --force-truncate -> --allow-overwrite * src/prefs.h (PREF_FORCE_TRUNCATE): Removed. (PREF_ALLOW_OVERWRITE): New definition. * src/SegmentMan.cc (shouldCancelDownloadForSafety): --force-truncate -> --allow-overwrite * src/MetalinkRequestInfo.cc (execute): Queueing message are now logged in info level. * src/common.h (LONG_LONG_MAX): Removed. (LONG_LONG_MIN): Removed. * src/HttpResponseCommand.cc (handleDefaultEncoding): LONG_LONG_MAX -> INT64_MAX * src/FtpNegotiateCommand.cc (recvSize): LONG_LONG_MAX -> INT64_MAX * src/main.cc (showUsage): Added --check-integiry and --realtime-chunk-checksum command-line option. (main): Added --check-integiry and --realtime-chunk-checksum command-line option. --force-truncate -> --allow-overwrite Set initial value of --check-integrity option to false. Don't show usage when error occurs while persing command-line options. Removed deprecated --upload-limit option.
2007-01-28 14:18:35 +00:00
#define EX_FILE_ALREADY_EXISTS _("File %s exists, but %s does not exist. The download was canceled in order to prevent your file from being truncated to 0. If you are sure to download file all over again, then delete it or add --allow-overwrite=true option and restart aria2.")
#define EX_INVALID_PAYLOAD_SIZE _("Invalid payload size for %s, size=%d. It should be %d.")
#define EX_INVALID_BT_MESSAGE_ID _("Invalid ID=%d for %s. It should be %d.")
#define EX_INVALID_CHUNK_CHECKSUM _("Chunk checksum validation failed. checksumIndex=%d, offset=%lld, length=%d, expectedHash=%s, actualHash=%s")
2006-02-17 13:35:04 +00:00
#endif // _D_MESSAGE_H_