1 /* <!-- copyright */
2 /*
3  * aria2 - The high speed download utility
4  *
5  * Copyright (C) 2006 Tatsuhiro Tsujikawa
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20  *
21  * In addition, as a special exception, the copyright holders give
22  * permission to link the code of portions of this program with the
23  * OpenSSL library under certain conditions as described in each
24  * individual source file, and distribute linked combinations
25  * including the two.
26  * You must obey the GNU General Public License in all respects
27  * for all of the code used other than OpenSSL.  If you modify
28  * file(s) with this exception, you may extend this exception to your
29  * version of the file(s), but you are not obligated to do so.  If you
30  * do not wish to do so, delete this exception statement from your
31  * version.  If you delete this exception statement from all source
32  * files in the program, then also delete it here.
33  */
34 /* copyright --> */
35 #ifndef D_MESSAGE_H
36 #define D_MESSAGE_H
37 
38 #include "common.h"
39 
40 // clang-format off
41 
42 #define MSG_SEGMENT_DOWNLOAD_COMPLETED                                  \
43   "CUID#%" PRId64 " - The download for one segment completed successfully."
44 #define MSG_NO_SEGMENT_AVAILABLE "CUID#%" PRId64 " - No segment available."
45 #define MSG_CONNECTING_TO_SERVER "CUID#%" PRId64 " - Connecting to %s:%d"
46 #define MSG_REDIRECT "CUID#%" PRId64 " - Redirecting to %s"
47 #define MSG_SENDING_REQUEST "CUID#%" PRId64 " - Requesting:\n%s"
48 #define MSG_RECEIVE_RESPONSE "CUID#%" PRId64 " - Response received:\n%s"
49 #define MSG_DOWNLOAD_ABORTED "CUID#%" PRId64 " - Download aborted. URI=%s"
50 #define MSG_RESTARTING_DOWNLOAD "CUID#%" PRId64 " - Restarting the download. URI=%s"
51 #define MSG_TORRENT_DOWNLOAD_ABORTED "CUID#%" PRId64 " - Download aborted."
52 #define MSG_MAX_TRY                                                     \
53   "CUID#%" PRId64 " - %d times attempted, but no success. Download aborted."
54 #define MSG_SEND_PEER_MESSAGE "CUID#%" PRId64 " - To: %s:%d %s"
55 #define MSG_RECEIVE_PEER_MESSAGE "CUID#%" PRId64 " - From: %s:%d %s"
56 #define MSG_GOT_NEW_PIECE "CUID#%" PRId64 " - we got new piece. index=%lu"
57 #define MSG_GOT_WRONG_PIECE "CUID#%" PRId64 " - we got wrong piece. index=%lu"
58 #define MSG_DOWNLOAD_NOT_COMPLETE "CUID#%" PRId64 " - Download not complete: %s"
59 #define MSG_DOWNLOAD_ALREADY_COMPLETED _("GID#%s - Download has already completed: %s")
60 #define MSG_RESOLVING_HOSTNAME "CUID#%" PRId64 " - Resolving hostname %s"
61 #define MSG_NAME_RESOLUTION_COMPLETE                    \
62   "CUID#%" PRId64 " - Name resolution complete: %s -> %s"
63 #define MSG_NAME_RESOLUTION_FAILED                      \
64   "CUID#%" PRId64 " - Name resolution for %s failed:%s"
65 #define MSG_DNS_CACHE_HIT "CUID#%" PRId64 " - DNS cache hit: %s -> %s"
66 #define MSG_CONNECTING_TO_PEER "CUID#%" PRId64 " - Connecting to the peer %s"
67 #define MSG_PIECE_RECEIVED                                              \
68   "CUID#%" PRId64 " - Piece received. index=%lu, begin=%d, length=%d, offset=%" PRId64 "," \
69   " blockIndex=%lu"
70 #define MSG_PIECE_BITFIELD "CUID#%" PRId64 " - Piece bitfield %s"
71 #define MSG_REJECT_PIECE_CHOKED                                         \
72   "CUID#%" PRId64 " - Reject piece message in queue because the peer has been" \
73   " choked. index=%lu, begin=%d, length=%d"
74 #define MSG_REJECT_PIECE_CANCEL                                         \
75   "CUID#%" PRId64 " - Reject piece message in queue because cancel message received." \
76   " index=%lu, begin=%d, length=%d"
77 #define MSG_FILE_VALIDATION_FAILURE                             \
78   "CUID#%" PRId64 " - Exception caught while validating file integrity."
79 #define MSG_PEER_INTERESTED "CUID#%" PRId64 " - Interested in the peer"
80 #define MSG_PEER_NOT_INTERESTED "CUID#%" PRId64 " - Not interested in the peer"
81 #define MSG_DELETING_REQUEST_SLOT "CUID#%" PRId64 " - Deleting request slot" \
82   " index=%lu, begin=%d, blockIndex=%lu"
83 #define MSG_DELETING_REQUEST_SLOT_CHOKED "CUID#%" PRId64 " - Deleting request slot" \
84   " index=%lu, begin=%d, blockIndex=%lu because localhost got choked."
85 #define MSG_DELETING_REQUEST_SLOT_TIMEOUT "CUID#%" PRId64 " - Deleting request slot" \
86   " index=%lu, begin=%d, blockIndex=%lu because of time out"
87 #define MSG_DELETING_REQUEST_SLOT_ACQUIRED "CUID#%" PRId64 " - Deleting request slot" \
88   " index=%lu, begin=%d, blockIndex=%lu because the block has been acquired."
89 #define MSG_FAST_EXTENSION_ENABLED "CUID#%" PRId64 " - Fast extension enabled."
90 #define MSG_EXTENDED_MESSAGING_ENABLED "CUID#%" PRId64 " - Extended Messaging enabled."
91 #define MSG_FILE_ALLOCATION_FAILURE                             \
92   "CUID#%" PRId64 " - Exception caught while allocating file space."
93 #define MSG_CONTENT_DISPOSITION_DETECTED                        \
94   "CUID#%" PRId64 " - Content-Disposition detected. Use %s as filename"
95 #define MSG_PEER_BANNED "CUID#%" PRId64 " - Peer %s:%d banned."
96 #define MSG_LISTENING_PORT                                      \
97   "CUID#%" PRId64 " - Using port %d for accepting new connections"
98 #define MSG_BIND_FAILURE "CUID#%" PRId64 " - An error occurred while binding port=%d"
99 #define MSG_INCOMING_PEER_CONNECTION                            \
100   "CUID#%" PRId64 " - Incoming connection, adding new command CUID#%" PRId64 ""
101 #define MSG_ACCEPT_FAILURE "CUID#%" PRId64 " - Error in accepting connection"
102 #define MSG_TRACKER_RESPONSE_PROCESSING_FAILED                  \
103   "CUID#%" PRId64 " - Error occurred while processing tracker response."
104 #define MSG_DHT_ENABLED_PEER "CUID#%" PRId64 " - The peer is DHT-enabled."
105 #define MSG_CONNECT_FAILED_AND_RETRY            \
106   "CUID#%" PRId64 " - Could not to connect to %s:%u. Trying another address"
107 
108 #define MSG_UNRECOGNIZED_URI _("Unrecognized URI or unsupported protocol: %s")
109 #define MSG_TRACKER_WARNING_MESSAGE _("Tracker returned warning message: %s")
110 #define MSG_SEGMENT_FILE_EXISTS _("The segment file %s exists.")
111 #define MSG_SEGMENT_FILE_DOES_NOT_EXIST _("The segment file %s does not exist.")
112 #define MSG_SAVING_SEGMENT_FILE _("Saving the segment file %s")
113 #define MSG_SAVED_SEGMENT_FILE _("The segment file was saved successfully.")
114 #define MSG_LOADING_SEGMENT_FILE _("Loading the segment file %s.")
115 #define MSG_LOADED_SEGMENT_FILE _("The segment file was loaded successfully.")
116 #define MSG_NO_URL_TO_DOWNLOAD _("No URI to download. Download aborted.")
117 #define MSG_FILE_ALREADY_EXISTS _("File %s exists, but a control file(*.aria2) does not exist. Download was canceled in order to prevent your file from being truncated to 0. If you are sure to download the file all over again, then delete it or add --allow-overwrite=true option and restart aria2.")
118 #define MSG_ALLOCATING_FILE _("Allocating file %s, %s bytes")
119 #define MSG_FILE_NOT_FOUND _("File not found")
120 #define MSG_NOT_DIRECTORY _("Not a directory")
121 #define MSG_INSUFFICIENT_CHECKSUM _("Insufficient checksums. checksumLength=%d, numChecksum=%d")
122 #define MSG_WRITING_FILE _("Writing file %s")
123 #define MSG_NO_PEER_LIST_RECEIVED _("No peer list received.")
124 #define MSG_ADDING_PEER _("Adding peer %s:%d")
125 #define MSG_DELETING_USED_PIECE _("Deleting used piece index=%d, fillRate(%%)=%d<=%d")
126 #define MSG_SELECTIVE_DOWNLOAD_COMPLETED _("Download of selected files was complete.")
127 #define MSG_DOWNLOAD_COMPLETED _("The download was complete.")
128 #define MSG_REMOVED_HAVE_ENTRY _("Removed %lu have entries.")
129 #define MSG_VALIDATING_FILE _("Validating file %s")
130 #define MSG_ALLOCATION_COMPLETED "%ld seconds to allocate %" PRId64 " byte(s)"
131 #define MSG_FILE_ALLOCATION_DISPATCH                    \
132   "Dispatching FileAllocationCommand for CUID#%" PRId64 "."
133 #define MSG_METALINK_QUEUEING _("Metalink: Queueing %s for download.")
134 #define MSG_FILE_DOWNLOAD_COMPLETED _("Download complete: %s")
135 #define MSG_SEEDING_END _("Seeding is over.")
136 #define MSG_NO_CHUNK_CHECKSUM _("No chunk to verify.")
137 #define MSG_GOOD_CHUNK_CHECKSUM _("Good chunk checksum. hash=%s")
138 #define MSG_LOADING_COOKIE_FAILED _("Failed to load cookies from %s")
139 #define MSG_INCORRECT_NETRC_PERMISSION _(".netrc file %s does not have correct permissions. It should be 600. netrc support disabled.")
140 #define MSG_LOGGING_STARTED _("Logging started.")
141 #define MSG_URI_REQUIRED _("Specify at least one URL.")
142 #define MSG_DAEMON_FAILED _("daemon failed.")
143 #define MSG_VERIFICATION_SUCCESSFUL _("Verification finished successfully. file=%s")
144 #define MSG_VERIFICATION_FAILED _("Checksum error detected. file=%s")
145 #define MSG_INCOMPLETE_RANGE _("Incomplete range specified. %s")
146 #define MSG_STRING_INTEGER_CONVERSION_FAILURE _("Failed to convert string into value: %s")
147 #define MSG_RESOURCE_NOT_FOUND _("Resource not found")
148 #define MSG_FILE_RENAMED _("File already exists. Renamed to %s.")
149 #define MSG_CANNOT_PARSE_METALINK _("Cannot parse metalink XML file. XML may be malformed.")
150 #define MSG_TOO_SMALL_PAYLOAD_SIZE _("Too small payload size for %s, size=%lu.")
151 #define MSG_REMOVED_DEFUNCT_CONTROL_FILE _("Removed the defunct control file %s because the download file %s doesn't exist.")
152 #define MSG_SHARE_RATIO_REPORT _("Your share ratio was %.1f, uploaded/downloaded=%sB/%sB")
153 #define MSG_MISSING_BT_INFO _("Missing %s in torrent metainfo.")
154 #define MSG_NEGATIVE_LENGTH_BT_INFO _("%s does not allow negative integer %" PRId64 "")
155 #define MSG_NULL_TRACKER_RESPONSE _("Tracker returned null data.")
156 #define MSG_WINSOCK_INIT_FAILD _("Windows socket library initialization failed")
157 #define MSG_TIME_HAS_PASSED _("%ld second(s) has passed. Stopping application.")
158 #define MSG_SIGNATURE_SAVED _("Saved signature as %s. Please note that aria2" \
159                               " doesn't verify signatures.")
160 #define MSG_SIGNATURE_NOT_SAVED _("Saving signature as %s failed. Maybe file" \
161                                   " already exists.")
162 #define MSG_OPENING_READABLE_SERVER_STAT_FILE_FAILED    \
163   _("Failed to open ServerStat file %s for read.")
164 #define MSG_SERVER_STAT_LOADED _("ServerStat file %s loaded successfully.")
165 #define MSG_READING_SERVER_STAT_FILE_FAILED _("Failed to read ServerStat from" \
166                                               " %s.")
167 #define MSG_OPENING_WRITABLE_SERVER_STAT_FILE_FAILED    \
168   _("Failed to open ServerStat file %s for write.")
169 #define MSG_SERVER_STAT_SAVED _("ServerStat file %s saved successfully.")
170 #define MSG_WRITING_SERVER_STAT_FILE_FAILED _("Failed to write ServerStat to" \
171                                               " %s.")
172 #define MSG_ESTABLISHING_CONNECTION_FAILED              \
173   _("Failed to establish connection, cause: %s")
174 #define MSG_NETWORK_PROBLEM _("Network problem has occurred. cause:%s")
175 #define MSG_LOADING_SYSTEM_TRUSTED_CA_CERTS_FAILED                              \
176   _("Failed to load trusted CA certificates from system. Cause: %s")
177 #define MSG_LOADING_TRUSTED_CA_CERT_FAILED                              \
178   _("Failed to load trusted CA certificates from %s. Cause: %s")
179 #define MSG_CERT_VERIFICATION_FAILED                    \
180   _("Certificate verification failed. Cause: %s See --ca-certificate and" \
181     " --check-certificate option.")
182 #define MSG_NO_CERT_FOUND _("No certificate found.")
183 #define MSG_HOSTNAME_NOT_MATCH _("Hostname not match.")
184 #define MSG_NO_FILES_TO_DOWNLOAD _("No files to download.")
185 #define MSG_WARN_NO_CA_CERT                                             \
186   _("You may encounter the certificate verification error with HTTPS server." \
187     " See --ca-certificate and --check-certificate option.")
188 #define MSG_WARN_UNKNOWN_TLS_CONNECTION \
189   _("aria2c had to connect to the other side using an unknown TLS protocol. " \
190     "The integrity and confidentiality of the connection might be " \
191     "compromised.\nPeer: %s")
192 #define MSG_WARN_OLD_TLS_CONNECTION \
193   _("aria2c had to connect to the other side using an old and vulnerable TLS" \
194     " protocol. The integrity and confidentiality of the connection might be" \
195     " compromised.\nProtocol: %s, Peer: %s")
196 #define MSG_SHOW_FILES _("Printing the contents of file '%s'...")
197 #define MSG_NOT_TORRENT_METALINK _("This file is neither Torrent nor Metalink" \
198                                    " file. Skipping.")
199 #define MSG_GID_NOT_PROVIDED "GID is not provided."
200 #define MSG_CANNOT_PARSE_XML_RPC_REQUEST "Failed to parse xml-rpc request."
201 #define MSG_GOOD_BYE_SEEDER "Client is in seed state: Good Bye Seeder;)"
202 #define MSG_NOT_FILE _("Is '%s' a file?")
203 #define MSG_INTERFACE_NOT_FOUND _("Failed to find given interface %s,"  \
204                                   " cause: %s")
205 #define MSG_METADATA_SAVED _("Saved metadata as %s.")
206 #define MSG_METADATA_NOT_SAVED _("Saving metadata as %s failed. Maybe file" \
207                                  " already exists.")
208 #define MSG_DIR_TRAVERSAL_DETECTED _("Detected directory traversal directive in %s")
209 #define MSG_HASH_CHECK_NOT_DONE                                         \
210   "File has already been downloaded but hash check has not been done yet."
211 #define MSG_REMOVING_UNSELECTED_FILE _("GID#%s - Removing unselected file.")
212 #define MSG_FILE_REMOVED _("File %s removed.")
213 #define MSG_FILE_COULD_NOT_REMOVED _("File %s could not be removed.")
214 
215 #define EX_TIME_OUT _("Timeout.")
216 #define EX_INVALID_CHUNK_SIZE _("Invalid chunk size.")
217 #define EX_TOO_LARGE_CHUNK _("Too large chunk. size=%d")
218 #define EX_INVALID_HEADER _("Invalid header.")
219 #define EX_INVALID_RESPONSE _("Invalid response.")
220 #define EX_NO_HEADER _("No header found.")
221 #define EX_NO_STATUS_HEADER _("No status header.")
222 #define EX_PROXY_CONNECTION_FAILED _("Proxy connection failed.")
223 #define EX_CONNECTION_FAILED _("Connection failed.")
224 #define EX_FILENAME_MISMATCH _("The requested filename and the previously registered one are not same. Expected:%s Actual:%s")
225 #define EX_BAD_STATUS _("The response status is not successful. status=%d")
226 #define EX_TOO_LARGE_FILE "Too large file size. size=%" PRId64 ""
227 #define EX_TRANSFER_ENCODING_NOT_SUPPORTED _("Transfer encoding %s is not supported.")
228 #define EX_SSL_INIT_FAILURE _("SSL initialization failed: %s")
229 #define EX_SSL_IO_ERROR _("SSL I/O error")
230 #define EX_SSL_PROTOCOL_ERROR _("SSL protocol error")
231 #define EX_SSL_UNKNOWN_ERROR _("SSL unknown error %d")
232 #define EX_SSL_CONNECT_ERROR _("SSL initialization failed: OpenSSL connect error %d")
233 #define EX_SIZE_MISMATCH "Size mismatch Expected:%" PRId64 " Actual:%" PRId64 ""
234 #define EX_AUTH_FAILED _("Authorization failed.")
235 #define EX_GOT_EOF _("Got EOF from the server.")
236 #define EX_EOF_FROM_PEER _("Got EOF from peer.")
237 #define EX_MALFORMED_META_INFO _("Malformed meta info.")
238 
239 #define EX_FILE_OPEN _("Failed to open the file %s, cause: %s")
240 #define EX_FILE_WRITE _("Failed to write into the file %s, cause: %s")
241 #define EX_FILE_READ _("Failed to read from the file %s, cause: %s")
242 #define EX_DATA_READ _("Failed to read data from disk.")
243 #define EX_FILE_SHA1SUM _("Failed to calculate SHA1 digest of or a part of the file %s, cause: %s")
244 #define EX_FILE_SEEK _("Failed to seek the file %s, cause: %s")
245 #define EX_FILE_OFFSET_OUT_OF_RANGE "The offset is out of range, offset=%" PRId64 ""
246 #define EX_NOT_DIRECTORY _("%s is not a directory.")
247 #define EX_MAKE_DIR _("Failed to make the directory %s, cause: %s")
248 #define EX_SEGMENT_FILE_WRITE "Failed to write into the segment file %s"
249 #define EX_SEGMENT_FILE_READ "Failed to read from the segment file %s"
250 
251 #define EX_SOCKET_OPEN _("Failed to open a socket, cause: %s")
252 #define EX_SOCKET_SET_OPT _("Failed to set a socket option, cause: %s")
253 #define EX_SOCKET_BLOCKING _("Failed to set a socket as blocking, cause: %s")
254 #define EX_SOCKET_NONBLOCKING _("Failed to set a socket as non-blocking, cause: %s")
255 #define EX_SOCKET_BIND _("Failed to bind a socket, cause: %s")
256 #define EX_SOCKET_LISTEN _("Failed to listen to a socket, cause: %s")
257 #define EX_SOCKET_ACCEPT _("Failed to accept a peer connection, cause: %s")
258 #define EX_SOCKET_GET_NAME _("Failed to get the name of socket, cause: %s")
259 #define EX_SOCKET_GET_PEER _("Failed to get the name of connected peer, cause: %s")
260 #define EX_RESOLVE_HOSTNAME _("Failed to resolve the hostname %s, cause: %s")
261 #define EX_SOCKET_CONNECT _("Failed to connect to the host %s, cause: %s")
262 #define EX_SOCKET_CHECK_WRITABLE _("Failed to check whether the socket is writable, cause: %s")
263 #define EX_SOCKET_CHECK_READABLE _("Failed to check whether the socket is readable, cause: %s")
264 #define EX_SOCKET_SEND _("Failed to send data, cause: %s")
265 #define EX_SOCKET_RECV _("Failed to receive data, cause: %s")
266 #define EX_SOCKET_PEEK _("Failed to peek data, cause: %s")
267 #define EX_SOCKET_UNKNOWN_ERROR _("Unknown socket error %d (0x%x)")
268 #define EX_FILE_ALREADY_EXISTS _("File %s exists, but %s does not exist.")
269 #define EX_INVALID_PAYLOAD_SIZE                                 \
270   _("Invalid payload size for %s, size=%lu. It should be %lu.")
271 #define EX_INVALID_BT_MESSAGE_ID _("Invalid ID=%d for %s. It should be %d.")
272 #define EX_INVALID_CHUNK_CHECKSUM "Chunk checksum validation failed. checksumIndex=%lu, offset=%" PRId64 ", expectedHash=%s, actualHash=%s"
273 #define EX_DOWNLOAD_ABORTED _("Download aborted.")
274 #define EX_DUPLICATE_FILE_DOWNLOAD _("File %s is being downloaded by other command.")
275 #define EX_INSUFFICIENT_CHECKSUM _("Insufficient checksums.")
276 #define EX_TRACKER_FAILURE _("Tracker returned failure reason: %s")
277 #define EX_FLOODING_DETECTED _("Flooding detected.")
278 #define EX_DROP_INACTIVE_CONNECTION \
279   _("Drop connection because no request/piece messages were exchanged in a" \
280     " certain period(%ld seconds).")
281 #define EX_INFOHASH_MISMATCH_IN_SEGFILE _("The infoHash in torrent file doesn't match to one in .aria2 file.")
282 #define EX_NO_SUCH_FILE_ENTRY _("No such file entry %s")
283 #define EX_TOO_SLOW_DOWNLOAD_SPEED _("Too slow Downloading speed: %d <= %d(B/s), host:%s")
284 #define EX_NO_HTTP_REQUEST_ENTRY_FOUND _("No HttpRequestEntry found.")
285 #define EX_LOCATION_HEADER_REQUIRED _("Got %d status, but no location header provided.")
286 #define EX_INVALID_RANGE_HEADER "Invalid range header. Request: %" PRId64 "-%" PRId64 "/%" PRId64 ", Response: %" PRId64 "-%" PRId64 "/%" PRId64 ""
287 #define EX_NO_RESULT_WITH_YOUR_PREFS _("No file matched with your preference.")
288 #define EX_EXCEPTION_CAUGHT _("Exception caught")
289 #define EX_TOO_LONG_PAYLOAD _("Max payload length exceeded or invalid. length = %u")
290 #define EX_FILE_LENGTH_MISMATCH_BETWEEN_LOCAL_AND_REMOTE _("Invalid file length. Cannot continue download %s: local %s, remote %s")
291 
292 // clang-format on
293 
294 #endif // D_MESSAGE_H
295