Codebase list nzbget / d9704cc
New upstream release. Debian Janitor 2 years ago
21 changed file(s) with 210 addition(s) and 232 deletion(s). Raw diff Collapse all Expand all
0 nzbget-21.1:
0 nzbget-21.2-testing:
11 - please see repository change log at
22 https://github.com/nzbget/nzbget/commits/develop
3
4 nzbget-21.1:
5 - fixed crash on systems with 64-bit time;
6 - corrected icon in Windows "uninstall program" list;
7 - allow special characters in URL for username and password;
8 - improved reporting for binding errors on Windows;
9 - fixed unicode space characters in javascript files, which could cause issues
10 with nginx proxy;
11 - fixed negative values for "FileSizeLo" in json-rpc;
12 - corrected url detection in rpc-method "append";
13 - added support for new error messages in unrar 5.80;
14 - now always using snapshots when reading directory contents:
15 - in previous versions snapshots were used on macOS only;
16 - now they are used on all OSes;
17 - this solves issue with leftovers during directory cleanup, which could
18 happen on certain OSes when working with network drives;
19 - fixed file allocating on file systems where sparse files are not supported:
20 - the issue could happen when InterDir was located on a network drive;
21 - fixed crash caused by malformed nzb files;
22 - fixed GROUP command in nserv;
23 - updated url of the global certificate storage file in the build scripts;
24 - fixed: file selector in WebKit based browsers doesn't allow to choose the
25 same file again;
26 - removed outdated links from web interface;
27 - fixed PC sleep mode not working (Windows only);
28 - set "SameSite" attribute for cookies;
29 - corrected typo in about dialog of web interface;
30 - updated license text: changed address of Free Software Foundation and minor
31 formatting changes.
332
433 nzbget-21.0:
534 - reworked duplicate handling to support URLs, especially when using RSS
1010 NZBGet is a binary downloader, which downloads files from Usenet
1111 based on information given in nzb-files.
1212
13 NZBGet is written in C++ and is known for its extraordinary performance and efficiency.
13 NZBGet is written in C++ and is known for its performance and efficiency.
1414
15 NZBGet can be run on almost every device - classic PCs, NAS, media players, SAT-receivers, WLAN-routers, etc.
16 The download area provides precompiled binaries
17 for Windows, macOS, Linux (compatible with many CPUs and platform variants), FreeBSD and Android. For other platforms
18 the program can be compiled from sources.
19
20 - [Home page (nzbget.net)](http://nzbget.net) - learn more about NZBGet;
21 - [Downloads](http://nzbget.net/download) - get compiled binaries and sources;
22 - [Documentation](http://nzbget.net/documentation) - installation manuals, HOW-TOs, API;
23 - [Forum](http://forum.nzbget.net) - get support, share your ideas, scripts, add-ons.
15 NZBGet can run on almost any device - classic PC, NAS, media player, SAT-receiver, WLAN-router, etc.
16 The download area provides precompiled binaries for Windows, macOS, Linux (compatible with
17 many CPUs and platform variants), FreeBSD and Android. For other platforms
18 the program can be compiled from sources.
11
22 /* Define to 1 to include debug-code */
33 #undef DEBUG
4
5 /* Define to 1 if deleting of files during reading of directory is not
6 properly supported by OS */
7 #undef DIRBROWSER_SNAPSHOT
84
95 /* Define to 1 to not use curses */
106 #undef DISABLE_CURSES
00 #! /bin/sh
11 # Guess values for system-dependent variables and create Makefiles.
2 # Generated by GNU Autoconf 2.69 for nzbget 21.1-testing.
2 # Generated by GNU Autoconf 2.69 for nzbget 21.2-testing.
33 #
44 # Report bugs to <hugbug@users.sourceforge.net>.
55 #
579579 # Identity of this package.
580580 PACKAGE_NAME='nzbget'
581581 PACKAGE_TARNAME='nzbget'
582 PACKAGE_VERSION='21.1-testing'
583 PACKAGE_STRING='nzbget 21.1-testing'
582 PACKAGE_VERSION='21.2-testing'
583 PACKAGE_STRING='nzbget 21.2-testing'
584584 PACKAGE_BUGREPORT='hugbug@users.sourceforge.net'
585585 PACKAGE_URL=''
586586
13471347 # Omit some internal or obsolete options to make the list less imposing.
13481348 # This message is too long to be a string in the A/UX 3.1 sh.
13491349 cat <<_ACEOF
1350 \`configure' configures nzbget 21.1-testing to adapt to many kinds of systems.
1350 \`configure' configures nzbget 21.2-testing to adapt to many kinds of systems.
13511351
13521352 Usage: $0 [OPTION]... [VAR=VALUE]...
13531353
14181418
14191419 if test -n "$ac_init_help"; then
14201420 case $ac_init_help in
1421 short | recursive ) echo "Configuration of nzbget 21.1-testing:";;
1421 short | recursive ) echo "Configuration of nzbget 21.2-testing:";;
14221422 esac
14231423 cat <<\_ACEOF
14241424
15831583 test -n "$ac_init_help" && exit $ac_status
15841584 if $ac_init_version; then
15851585 cat <<\_ACEOF
1586 nzbget configure 21.1-testing
1586 nzbget configure 21.2-testing
15871587 generated by GNU Autoconf 2.69
15881588
15891589 Copyright (C) 2012 Free Software Foundation, Inc.
20522052 This file contains any messages produced by compilers while
20532053 running configure, to aid debugging if configure makes a mistake.
20542054
2055 It was created by nzbget $as_me 21.1-testing, which was
2055 It was created by nzbget $as_me 21.2-testing, which was
20562056 generated by GNU Autoconf 2.69. Invocation command line was
20572057
20582058 $ $0 $@
30253025
30263026 # Define the identity of the package.
30273027 PACKAGE='nzbget'
3028 VERSION='21.1-testing'
3028 VERSION='21.2-testing'
30293029
30303030
30313031 cat >>confdefs.h <<_ACEOF
66106610
66116611
66126612
6613 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether dir-browser snapshot workaround is needed" >&5
6614 $as_echo_n "checking whether dir-browser snapshot workaround is needed... " >&6; }
6615 if test "$target_vendor" == "apple"; then
6616 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
6617 $as_echo "yes" >&6; }
6618
6619 $as_echo "#define DIRBROWSER_SNAPSHOT 1" >>confdefs.h
6620
6621 else
6622 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6623 $as_echo "no" >&6; }
6624 fi
6625
6626
66276613 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cpu cores via sysconf" >&5
66286614 $as_echo_n "checking for cpu cores via sysconf... " >&6; }
66296615 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
91769162 # report actual input values of CONFIG_FILES etc. instead of their
91779163 # values after options handling.
91789164 ac_log="
9179 This file was extended by nzbget $as_me 21.1-testing, which was
9165 This file was extended by nzbget $as_me 21.2-testing, which was
91809166 generated by GNU Autoconf 2.69. Invocation command line was
91819167
91829168 CONFIG_FILES = $CONFIG_FILES
92429228 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
92439229 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
92449230 ac_cs_version="\\
9245 nzbget config.status 21.1-testing
9231 nzbget config.status 21.2-testing
92469232 configured by $0, generated by GNU Autoconf 2.69,
92479233 with options \\"\$ac_cs_config\\"
92489234
00 #
11 # This file is part of nzbget. See <http://nzbget.net>.
22 #
3 # Copyright (C) 2008-2019 Andrey Prygunkov <hugbug@users.sourceforge.net>
3 # Copyright (C) 2008-2021 Andrey Prygunkov <hugbug@users.sourceforge.net>
44 #
55 # This program is free software; you can redistribute it and/or modify
66 # it under the terms of the GNU General Public License as published by
2020 # Process this file with autoconf to produce a configure script.
2121
2222 AC_PREREQ(2.65)
23 AC_INIT(nzbget, 21.1-testing, hugbug@users.sourceforge.net)
23 AC_INIT(nzbget, 21.2-testing, hugbug@users.sourceforge.net)
2424 AC_CONFIG_AUX_DIR(posix)
2525 AC_CANONICAL_TARGET
2626 AM_INIT_AUTOMAKE([foreign subdir-objects])
219219 AC_MSG_WARN(could not determine)
220220 SOCKLEN_T=int])])])
221221 AC_DEFINE_UNQUOTED(SOCKLEN_T, $SOCKLEN_T, [Determine what socket length (socklen_t) data type is])
222
223
224 dnl
225 dnl Dir-browser's snapshot
226 dnl
227 AC_MSG_CHECKING(whether dir-browser snapshot workaround is needed)
228 if test "$target_vendor" == "apple"; then
229 AC_MSG_RESULT([[yes]])
230 AC_DEFINE([DIRBROWSER_SNAPSHOT], 1, [Define to 1 if deleting of files during reading of directory is not properly supported by OS])
231 else
232 AC_MSG_RESULT([[no]])
233 fi
234222
235223
236224 dnl
208208 return true;
209209 }
210210
211 int errcode = 0;
212
211213 #ifndef WIN32
212214 if (m_host && m_host[0] == '/')
213215 {
279281 break;
280282 }
281283 // Connection failed
284 errcode = GetLastNetworkError();
282285 closesocket(m_socket);
283286 m_socket = INVALID_SOCKET;
284287 }
319322 if (res == -1)
320323 {
321324 // Connection failed
325 errcode = GetLastNetworkError();
322326 closesocket(m_socket);
323327 m_socket = INVALID_SOCKET;
324328 }
327331
328332 if (m_socket == INVALID_SOCKET)
329333 {
330 ReportError("Binding socket failed for %s", m_host, true);
334 ReportError("Binding socket failed for %s", m_host, true, errcode);
331335 return false;
332336 }
333337
784788 ret = connect(m_socket, (struct sockaddr*)address, address_len);
785789 if (ret < 0)
786790 {
791 int err = GetLastNetworkError();
787792 #ifdef WIN32
788 int err = WSAGetLastError();
789793 if (err != WSAEWOULDBLOCK)
790 {
791 return false;
792 }
793794 #else
794 if (errno != EINPROGRESS)
795 {
796 return false;
797 }
798 #endif
795 if (err != EINPROGRESS)
796 #endif
797 {
798 return false;
799 }
799800 }
800801
801802 //connect succeeded right away?
915916 }
916917 }
917918
918 void Connection::ReportError(const char* msgPrefix, const char* msgArg, bool PrintErrCode, int herrno, const char* herrMsg)
919 int Connection::GetLastNetworkError()
920 {
921 #ifdef WIN32
922 return WSAGetLastError();
923 #else
924 return errno;
925 #endif
926 }
927
928 void Connection::ReportError(const char* msgPrefix, const char* msgArg, bool printErrCode, int errCode, const char* errMsg)
919929 {
920930 #ifndef DISABLE_TLS
921931 if (m_tlsError)
928938
929939 BString<1024> errPrefix(msgPrefix, msgArg);
930940
931 if (PrintErrCode)
932 {
941 if (printErrCode)
942 {
943 BString<1024> printErrMsg;
944 if (errCode == 0)
945 {
946 errCode = GetLastNetworkError();
947 }
948 if (errMsg)
949 {
950 printErrMsg = errMsg;
951 }
952 else
953 {
933954 #ifdef WIN32
934 int ErrCode = WSAGetLastError();
935 char errMsg[1024];
936 errMsg[0] = '\0';
937 FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, nullptr, ErrCode, 0, errMsg, 1024, nullptr);
938 errMsg[1024-1] = '\0';
955 FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, nullptr, errCode, 0, printErrMsg, printErrMsg.Capacity(), nullptr);
956 printErrMsg[1024-1] = '\0';
939957 #else
940 const char* errMsg = herrMsg;
941 int ErrCode = herrno;
942 if (herrno == 0)
943 {
944 ErrCode = errno;
945 errMsg = strerror(ErrCode);
946 }
947 else if (!herrMsg)
948 {
949 errMsg = hstrerror(ErrCode);
950 }
951 #endif
958 printErrMsg = strerror(errCode);
959 #endif
960 }
961
952962 if (m_suppressErrors)
953963 {
954 debug("%s: ErrNo %i, %s", *errPrefix, ErrCode, errMsg);
964 debug("%s: Error %i - %s", *errPrefix, errCode, (const char*)printErrMsg);
955965 }
956966 else
957967 {
958 PrintError(BString<1024>("%s: ErrNo %i, %s", *errPrefix, ErrCode, errMsg));
968 PrintError(BString<1024>("%s: Error %i - %s", *errPrefix, errCode, (const char*)printErrMsg));
959969 }
960970 }
961971 else
10731083 #endif
10741084 if (err)
10751085 {
1076 ReportError("Could not resolve hostname %s", host, true, h_errnop);
1086 ReportError("Could not resolve hostname %s", host, true, h_errnop, hstrerror(h_errnop));
10771087 return INADDR_NONE;
10781088 }
10791089
135135 #endif
136136 #endif
137137
138 void ReportError(const char* msgPrefix, const char* msgArg, bool PrintErrCode, int herrno = 0,
139 const char* herrMsg = nullptr);
138 void ReportError(const char* msgPrefix, const char* msgArg, bool printErrCode, int errCode = 0,
139 const char* errMsg = nullptr);
140140 virtual void PrintError(const char* errMsg);
141 int GetLastNetworkError();
141142 bool DoConnect();
142143 bool DoDisconnect();
143144 bool InitSocketOpts(SOCKET socket);
171171 }
172172 else if (!strncasecmp(line, "GROUP ", 6))
173173 {
174 m_connection->WriteLine(CString::FormatStr("211 0 0 0 %s\r\n", line + 7));
174 m_connection->WriteLine(CString::FormatStr("211 0 0 0 %s\r\n", line + 6));
175175 }
176176 else if (!strncasecmp(line, "AUTHINFO ", 9))
177177 {
887887 m_unpackDecryptError = true;
888888 }
889889
890 if (m_unpacker == upUnrar && !strncmp(text, "Unrar: The specified password is incorrect.", 43))
890 if (m_unpacker == upUnrar && (!strncmp(text, "Unrar: The specified password is incorrect.", 43) ||
891 !strncmp(text, "Unrar: Incorrect password for", 29)))
891892 {
892893 m_unpackPasswordError = true;
893894 }
116116 {
117117 // Example subject: some garbage "title" yEnc (10/99)
118118
119 if (!fileInfo->GetSubject())
120 {
121 // Malformed file element without subject. We generate subject using internal element id.
122 fileInfo->SetSubject(CString::FormatStr("%d", fileInfo->GetId()));
123 }
124
119125 // strip the "yEnc (10/99)"-suffix
120126 BString<1024> subject = fileInfo->GetSubject();
121127 char* end = subject + strlen(subject) - 1;
221221 if (pauth1 && pauth1 < pauth2)
222222 {
223223 char* pstart = m_url + 1;
224 int len = 0;
225 char* pend = strchr(pstart + 1, '/');
226 if (pend)
227 {
228 len = (int)(pend - pstart < (int)sizeof(m_authInfo) - 1 ? pend - pstart : (int)sizeof(m_authInfo) - 1);
229 }
230 else
231 {
232 len = strlen(pstart);
233 }
224 char* pend = pauth2;
225 int len = std::min((int)(pend - pstart), (int)sizeof(m_authInfo) - 1);
234226 strncpy(m_authInfo, pstart, len);
235227 m_authInfo[len] = '\0';
228 WebUtil::UrlDecode(m_authInfo);
236229 m_url = CString(pend);
237230 }
238231
465458 "Access-Control-Allow-Credentials: true\r\n"
466459 "Access-Control-Max-Age: 86400\r\n"
467460 "Access-Control-Allow-Headers: Content-Type, Authorization\r\n"
468 "Set-Cookie: Auth-Type=%s\r\n"
469 "Set-Cookie: Auth-Token=%s; HttpOnly\r\n"
461 "Set-Cookie: Auth-Type=%s; SameSite=Lax\r\n"
462 "Set-Cookie: Auth-Token=%s; HttpOnly; SameSite=Lax\r\n"
470463 "Content-Length: %i\r\n"
471464 "%s" // Content-Type: xxx
472465 "%s" // Content-Encoding: gzip
14421442
14431443 AppendCondResponse(",\n", IsJson() && index++ > 0);
14441444 AppendFmtResponse(IsJson() ? JSON_LOG_ITEM : XML_LOG_ITEM,
1445 message.GetId(), messageType[message.GetKind()], message.GetTime(),
1445 message.GetId(), messageType[message.GetKind()], (int)message.GetTime(),
14461446 *EncodeStr(message.GetText()));
14471447 }
14481448
15491549 AppendCondResponse(",\n", IsJson() && index++ > 0);
15501550 AppendFmtResponse(IsJson() ? JSON_LIST_ITEM : XML_LIST_ITEM,
15511551 fileInfo->GetId(), fileSizeLo, fileSizeHi, remainingSizeLo, remainingSizeHi,
1552 fileInfo->GetTime(), BoolToStr(fileInfo->GetFilenameConfirmed()),
1552 (int)fileInfo->GetTime(), BoolToStr(fileInfo->GetFilenameConfirmed()),
15531553 BoolToStr(fileInfo->GetPaused()), fileInfo->GetNzbInfo()->GetId(),
15541554 *xmlNzbNicename, *xmlNzbNicename, *EncodeStr(fileInfo->GetNzbInfo()->GetFilename()),
15551555 *EncodeStr(fileInfo->GetSubject()), *EncodeStr(fileInfo->GetFilename()),
17471747 deleteStatusName[nzbInfo->GetDeleteStatus()], markStatusName[nzbInfo->GetMarkStatus()],
17481748 urlStatusName[nzbInfo->GetUrlStatus()],
17491749 fileSizeLo, fileSizeHi, fileSizeMB, nzbInfo->GetFileCount(),
1750 nzbInfo->GetMinTime(), nzbInfo->GetMaxTime(),
1750 (int)nzbInfo->GetMinTime(), (int)nzbInfo->GetMaxTime(),
17511751 nzbInfo->GetTotalArticles(), nzbInfo->GetCurrentSuccessArticles(), nzbInfo->GetCurrentFailedArticles(),
17521752 nzbInfo->CalcHealth(), nzbInfo->CalcCriticalHealth(false),
17531753 *EncodeStr(nzbInfo->GetDupeKey()), nzbInfo->GetDupeScore(), dupeModeName[nzbInfo->GetDupeMode()],
17541754 BoolToStr(nzbInfo->GetDeleteStatus() != NzbInfo::dsNone),
17551755 downloadedSizeLo, downloadedSizeHi, downloadedSizeMB, nzbInfo->GetDownloadSec(),
1756 nzbInfo->GetPostTotalSec() + (nzbInfo->GetPostInfo() && nzbInfo->GetPostInfo()->GetStartTime() ?
1757 Util::CurrentTime() - nzbInfo->GetPostInfo()->GetStartTime() : 0),
1756 (int)(nzbInfo->GetPostTotalSec() + (nzbInfo->GetPostInfo() && nzbInfo->GetPostInfo()->GetStartTime() ?
1757 Util::CurrentTime() - nzbInfo->GetPostInfo()->GetStartTime() : 0)),
17581758 nzbInfo->GetParSec(), nzbInfo->GetRepairSec(), nzbInfo->GetUnpackSec(), messageCount, nzbInfo->GetExtraParBlocks());
17591759
17601760 // Post-processing parameters
18551855
18561856 AppendFmtResponse(itemStart, *EncodeStr(postInfo->GetProgressLabel()),
18571857 postInfo->GetStageProgress(),
1858 postInfo->GetStageTime() ? curTime - postInfo->GetStageTime() : 0,
1859 postInfo->GetStartTime() ? curTime - postInfo->GetStartTime() : 0);
1858 (int)(postInfo->GetStageTime() ? curTime - postInfo->GetStageTime() : 0),
1859 (int)(postInfo->GetStartTime() ? curTime - postInfo->GetStartTime() : 0));
18601860 }
18611861 else
18621862 {
18831883
18841884 AppendCondResponse(",\n", IsJson() && index++ > 0);
18851885 AppendFmtResponse(IsJson() ? JSON_LOG_ITEM : XML_LOG_ITEM,
1886 message.GetId(), messageType[message.GetKind()], message.GetTime(),
1886 message.GetId(), messageType[message.GetKind()], (int)message.GetTime(),
18871887 *EncodeStr(message.GetText()));
18881888 }
18891889 }
22372237 }
22382238 }
22392239
2240 if (!strncasecmp(nzbContent, "http://", 6) || !strncasecmp(nzbContent, "https://", 7))
2240 if (!strncasecmp(nzbContent, "http://", 7) || !strncasecmp(nzbContent, "https://", 8))
22412241 {
22422242 // add url
22432243 std::unique_ptr<NzbInfo> nzbInfo = std::make_unique<NzbInfo>();
24632463 "\"Kind\" : \"%s\",\n"
24642464 "\"Name\" : \"%s\",\n"
24652465 "\"HistoryTime\" : %i,\n"
2466 "\"FileSizeLo\" : %i,\n"
2467 "\"FileSizeHi\" : %i,\n"
2466 "\"FileSizeLo\" : %u,\n"
2467 "\"FileSizeHi\" : %u,\n"
24682468 "\"FileSizeMB\" : %i,\n"
24692469 "\"DupeKey\" : \"%s\",\n"
24702470 "\"DupeScore\" : %i,\n"
25012501
25022502 AppendFmtResponse(IsJson() ? JSON_HISTORY_ITEM_START : XML_HISTORY_ITEM_START,
25032503 historyInfo->GetId(), *EncodeStr(historyInfo->GetName()), nzbInfo->GetParkedFileCount(),
2504 BoolToStr(nzbInfo->GetCompletedFiles()->size()), historyInfo->GetTime(), status);
2504 BoolToStr(nzbInfo->GetCompletedFiles()->size()), (int)historyInfo->GetTime(), status);
25052505 }
25062506 else if (historyInfo->GetKind() == HistoryInfo::hkDup)
25072507 {
25132513
25142514 AppendFmtResponse(IsJson() ? JSON_HISTORY_DUP_ITEM : XML_HISTORY_DUP_ITEM,
25152515 historyInfo->GetId(), historyInfo->GetId(), "DUP", *EncodeStr(historyInfo->GetName()),
2516 historyInfo->GetTime(), fileSizeLo, fileSizeHi, fileSizeMB,
2516 (int)historyInfo->GetTime(), fileSizeLo, fileSizeHi, fileSizeMB,
25172517 *EncodeStr(dupInfo->GetDupeKey()), dupInfo->GetDupeScore(),
25182518 dupeModeName[dupInfo->GetDupeMode()], dupStatusName[dupInfo->GetStatus()],
25192519 status);
28352835 "<member><name>Title</name><value><string>%s</string></value></member>\n"
28362836 "<member><name>Filename</name><value><string>%s</string></value></member>\n"
28372837 "<member><name>URL</name><value><string>%s</string></value></member>\n"
2838 "<member><name>SizeLo</name><value><i4>%i</i4></value></member>\n"
2839 "<member><name>SizeHi</name><value><i4>%i</i4></value></member>\n"
2838 "<member><name>SizeLo</name><value><i4>%u</i4></value></member>\n"
2839 "<member><name>SizeHi</name><value><i4>%u</i4></value></member>\n"
28402840 "<member><name>SizeMB</name><value><i4>%i</i4></value></member>\n"
28412841 "<member><name>Category</name><value><string>%s</string></value></member>\n"
28422842 "<member><name>AddCategory</name><value><string>%s</string></value></member>\n"
28562856 "\"Title\" : \"%s\",\n"
28572857 "\"Filename\" : \"%s\",\n"
28582858 "\"URL\" : \"%s\",\n"
2859 "\"SizeLo\" : %i,\n"
2860 "\"SizeHi\" : %i,\n"
2859 "\"SizeLo\" : %u,\n"
2860 "\"SizeHi\" : %u,\n"
28612861 "\"SizeMB\" : %i,\n"
28622862 "\"Category\" : \"%s\",\n"
28632863 "\"AddCategory\" : \"%s\",\n"
28922892 *EncodeStr(feedItemInfo.GetTitle()), *EncodeStr(feedItemInfo.GetFilename()),
28932893 *EncodeStr(feedItemInfo.GetUrl()), sizeLo, sizeHi, sizeMB,
28942894 *EncodeStr(feedItemInfo.GetCategory()), *EncodeStr(feedItemInfo.GetAddCategory()),
2895 BoolToStr(feedItemInfo.GetPauseNzb()), feedItemInfo.GetPriority(), feedItemInfo.GetTime(),
2895 BoolToStr(feedItemInfo.GetPauseNzb()), feedItemInfo.GetPriority(), (int)feedItemInfo.GetTime(),
28962896 matchStatusType[feedItemInfo.GetMatchStatus()], feedItemInfo.GetMatchRule(),
28972897 *EncodeStr(feedItemInfo.GetDupeKey()), feedItemInfo.GetDupeScore(),
28982898 dupeModeType[feedItemInfo.GetDupeMode()], statusType[feedItemInfo.GetStatus()]);
31183118 "\"ServerID\" : %i,\n"
31193119 "\"DataTime\" : %i,\n"
31203120 "\"FirstDay\" : %i,\n"
3121 "\"TotalSizeLo\" : %i,\n"
3122 "\"TotalSizeHi\" : %i,\n"
3121 "\"TotalSizeLo\" : %u,\n"
3122 "\"TotalSizeHi\" : %u,\n"
31233123 "\"TotalSizeMB\" : %i,\n"
3124 "\"CustomSizeLo\" : %i,\n"
3125 "\"CustomSizeHi\" : %i,\n"
3124 "\"CustomSizeLo\" : %u,\n"
3125 "\"CustomSizeHi\" : %u,\n"
31263126 "\"CustomSizeMB\" : %i,\n"
31273127 "\"CustomTime\" : %i,\n"
31283128 "\"SecSlot\" : %i,\n"
303303 errmsg = GetLastErrorMessage();
304304 return false;
305305 }
306 char c = '0';
307 fwrite(&c, 1, size, file);
306
307 // write zeros in 16K chunks
308 CharBuffer zeros(16 * 1024);
309 memset(zeros, 0, zeros.Size());
310 for (int64 remaining = size; remaining > 0;)
311 {
312 int64 needbytes = std::min(remaining, (int64)zeros.Size());
313 int64 written = fwrite(zeros, 1, needbytes, file);
314 if (written != needbytes)
315 {
316 errmsg = GetLastErrorMessage();
317 fclose(file);
318 return false;
319 }
320 remaining -= written;
321 }
308322 fclose(file);
323
309324 ok = FileSize(filename) == size;
325 if (!ok)
326 {
327 errmsg = "created file has wrong size";
328 }
310329 }
311330 #endif
312331 return ok;
10191038 #endif
10201039
10211040
1022 #ifdef WIN32
1023 DirBrowser::DirBrowser(const char* path)
1024 {
1025 BString<1024> mask("%s%c*.*", path, PATH_SEPARATOR);
1026 m_file = FindFirstFileW(FileSystem::UtfPathToWidePath(mask), &m_findData);
1027 m_first = true;
1028 }
1029
1030 DirBrowser::~DirBrowser()
1031 {
1032 if (m_file != INVALID_HANDLE_VALUE)
1033 {
1034 FindClose(m_file);
1035 }
1036 }
1037
1038 const char* DirBrowser::InternNext()
1039 {
1040 bool ok = false;
1041 if (m_first)
1042 {
1043 ok = m_file != INVALID_HANDLE_VALUE;
1044 m_first = false;
1045 }
1046 else
1047 {
1048 ok = FindNextFileW(m_file, &m_findData) != 0;
1049 }
1050 if (ok)
1051 {
1052 m_filename = FileSystem::WidePathToUtfPath(m_findData.cFileName);
1053 return m_filename;
1054 }
1055 return nullptr;
1056 }
1057
1058 #else
1059
1060 #ifdef DIRBROWSER_SNAPSHOT
10611041 DirBrowser::DirBrowser(const char* path, bool snapshot) :
10621042 m_snapshot(snapshot)
1063 #else
1064 DirBrowser::DirBrowser(const char* path)
1065 #endif
1066 {
1067 #ifdef DIRBROWSER_SNAPSHOT
1043 {
10681044 if (m_snapshot)
10691045 {
10701046 DirBrowser dir(path, false);
10751051 m_snapshotIter = m_snapshotFiles.begin();
10761052 }
10771053 else
1078 #endif
1079 {
1054 {
1055 #ifdef WIN32
1056 BString<1024> mask("%s%c*.*", path, PATH_SEPARATOR);
1057 m_file = FindFirstFileW(FileSystem::UtfPathToWidePath(mask), &m_findData);
1058 m_first = true;
1059 #else
10801060 m_dir = opendir(path);
1061 #endif
10811062 }
10821063 }
10831064
10841065 DirBrowser::~DirBrowser()
10851066 {
1086 #ifdef DIRBROWSER_SNAPSHOT
1087 if (!m_snapshot)
1088 #endif
1089 {
1090 if (m_dir)
1091 {
1092 closedir(m_dir);
1093 }
1094 }
1067 #ifdef WIN32
1068 if (m_file != INVALID_HANDLE_VALUE)
1069 {
1070 FindClose(m_file);
1071 }
1072 #else
1073 if (m_dir)
1074 {
1075 closedir(m_dir);
1076 }
1077 #endif
10951078 }
10961079
10971080 const char* DirBrowser::InternNext()
10981081 {
1099 #ifdef DIRBROWSER_SNAPSHOT
11001082 if (m_snapshot)
11011083 {
11021084 return m_snapshotIter == m_snapshotFiles.end() ? nullptr : **m_snapshotIter++;
11031085 }
11041086 else
1105 #endif
1106 {
1087 {
1088 #ifdef WIN32
1089 bool ok = false;
1090 if (m_first)
1091 {
1092 ok = m_file != INVALID_HANDLE_VALUE;
1093 m_first = false;
1094 }
1095 else
1096 {
1097 ok = FindNextFileW(m_file, &m_findData) != 0;
1098 }
1099 if (ok)
1100 {
1101 m_filename = FileSystem::WidePathToUtfPath(m_findData.cFileName);
1102 return m_filename;
1103 }
1104 #else
11071105 if (m_dir)
11081106 {
11091107 m_findData = readdir(m_dir);
11121110 return m_findData->d_name;
11131111 }
11141112 }
1113 #endif
11151114 return nullptr;
11161115 }
11171116 }
1118 #endif
11191117
11201118 const char* DirBrowser::Next()
11211119 {
8383 class DirBrowser
8484 {
8585 public:
86 #ifdef DIRBROWSER_SNAPSHOT
8786 DirBrowser(const char* path, bool snapshot = true);
88 #else
89 DirBrowser(const char* path);
90 #endif
9187 ~DirBrowser();
9288 const char* Next();
9389
9490 private:
9591 #ifdef WIN32
9692 WIN32_FIND_DATAW m_findData;
97 HANDLE m_file;
93 HANDLE m_file = INVALID_HANDLE_VALUE;
9894 bool m_first;
9995 CString m_filename;
10096 #else
10298 struct dirent* m_findData;
10399 #endif
104100
105 #ifdef DIRBROWSER_SNAPSHOT
106101 bool m_snapshot;
107102 typedef std::deque<CString> FileList;
108103 FileList m_snapshotFiles;
109104 FileList::iterator m_snapshotIter;
110 #endif
111105
112106 const char* InternNext();
113107 };
0 nzbget (21.2~r2333-1) UNRELEASED; urgency=low
1
2 * New upstream release.
3
4 -- Debian Janitor <janitor@jelmer.uk> Wed, 16 Mar 2022 01:37:58 -0000
5
06 nzbget (21.1~r2311+dfsg-2) experimental; urgency=medium
17
28 * Update standards version
182182
183183 echo "Updating root certificates"
184184 cd ../setup
185 curl --remote-name --time-cond cacert.pem https://curl.haxx.se/ca/cacert.pem
185 curl --remote-name --time-cond cacert.pem https://curl.se/ca/cacert.pem
186 # remove expired DST Root CA X3 certificate
187 sed '/^DST Root CA X3$/,/^-----END CERTIFICATE-----$/d;' -i cacert.pem
186188 cd $BUILDDIR
187189 fi
188190 }
7979 <ClCompile>
8080 <Optimization>Disabled</Optimization>
8181 <AdditionalIncludeDirectories>.\daemon\connect;.\daemon\extension;.\daemon\feed;.\daemon\frontend;.\daemon\main;.\daemon\nserv;.\daemon\nntp;.\daemon\postprocess;.\daemon\queue;.\daemon\remote;.\daemon\util;.\daemon\windows;.\lib\par2;.\lib\yencode;.\windows\resources;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
82 <PreprocessorDefinitions>WIN32;PACKAGE="nzbget";VERSION="21.1-testing";_DEBUG;_CONSOLE;DEBUG;_WIN32_WINNT=0x0403;%(PreprocessorDefinitions)</PreprocessorDefinitions>
82 <PreprocessorDefinitions>WIN32;PACKAGE="nzbget";VERSION="21.2-testing";_DEBUG;_CONSOLE;DEBUG;_WIN32_WINNT=0x0403;%(PreprocessorDefinitions)</PreprocessorDefinitions>
8383 <MinimalRebuild>false</MinimalRebuild>
8484 <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
8585 <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
100100 <ClCompile>
101101 <Optimization>Disabled</Optimization>
102102 <AdditionalIncludeDirectories>.\daemon\connect;.\daemon\extension;.\daemon\feed;.\daemon\frontend;.\daemon\main;.\daemon\nserv;.\daemon\nntp;.\daemon\postprocess;.\daemon\queue;.\daemon\remote;.\daemon\util;.\daemon\windows;.\lib\par2;.\lib\yencode;.\windows\resources;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
103 <PreprocessorDefinitions>WIN32;PACKAGE="nzbget";VERSION="21.1-testing";_DEBUG;_CONSOLE;DEBUG;_WIN32_WINNT=0x0403;%(PreprocessorDefinitions)</PreprocessorDefinitions>
103 <PreprocessorDefinitions>WIN32;PACKAGE="nzbget";VERSION="21.2-testing";_DEBUG;_CONSOLE;DEBUG;_WIN32_WINNT=0x0403;%(PreprocessorDefinitions)</PreprocessorDefinitions>
104104 <MinimalRebuild>false</MinimalRebuild>
105105 <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
106106 <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
119119 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
120120 <ClCompile>
121121 <AdditionalIncludeDirectories>.\daemon\connect;.\daemon\extension;.\daemon\feed;.\daemon\frontend;.\daemon\main;.\daemon\nserv;.\daemon\nntp;.\daemon\postprocess;.\daemon\queue;.\daemon\remote;.\daemon\util;.\daemon\windows;.\lib\par2;.\lib\yencode;.\windows\resources;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
122 <PreprocessorDefinitions>WIN32;PACKAGE="nzbget";VERSION="21.1-testing";NDEBUG;_CONSOLE;_WIN32_WINNT=0x0403;%(PreprocessorDefinitions)</PreprocessorDefinitions>
122 <PreprocessorDefinitions>WIN32;PACKAGE="nzbget";VERSION="21.2-testing";NDEBUG;_CONSOLE;_WIN32_WINNT=0x0403;%(PreprocessorDefinitions)</PreprocessorDefinitions>
123123 <ExceptionHandling>Sync</ExceptionHandling>
124124 <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
125125 <PrecompiledHeader>Use</PrecompiledHeader>
150150 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
151151 <ClCompile>
152152 <AdditionalIncludeDirectories>.\daemon\connect;.\daemon\extension;.\daemon\feed;.\daemon\frontend;.\daemon\main;.\daemon\nserv;.\daemon\nntp;.\daemon\postprocess;.\daemon\queue;.\daemon\remote;.\daemon\util;.\daemon\windows;.\lib\par2;.\lib\yencode;.\windows\resources;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
153 <PreprocessorDefinitions>WIN32;PACKAGE="nzbget";VERSION="21.1-testing";NDEBUG;_CONSOLE;_WIN32_WINNT=0x0403;%(PreprocessorDefinitions)</PreprocessorDefinitions>
153 <PreprocessorDefinitions>WIN32;PACKAGE="nzbget";VERSION="21.2-testing";NDEBUG;_CONSOLE;_WIN32_WINNT=0x0403;%(PreprocessorDefinitions)</PreprocessorDefinitions>
154154 <ExceptionHandling>Sync</ExceptionHandling>
155155 <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
156156 <PrecompiledHeader>Use</PrecompiledHeader>
503503 var $ConfigTabBadgeEmpty;
504504 var $ConfigContent;
505505 var $ConfigInfo;
506 var $ConfigAbout;
507506 var $ConfigTitle;
508507 var $ConfigTable;
509508 var $ViewButton;
532531 $ConfigTabBadgeEmpty = $('#ConfigTabBadgeEmpty');
533532 $ConfigContent = $('#ConfigContent');
534533 $ConfigInfo = $('#ConfigInfo');
535 $ConfigAbout = $('#ConfigAbout');
536534 $ConfigTitle = $('#ConfigTitle');
537535 $ViewButton = $('#Config_ViewButton');
538536 $LeaveConfigDialog = $('#LeaveConfigDialog');
12101208 $('li', $ConfigNav).removeClass('active');
12111209 link.closest('li').addClass('active');
12121210 $ConfigContent.removeClass('search');
1213 Util.show($ViewButton, sectionId !== 'Config-Info' && sectionId !== 'Config-About');
1211 Util.show($ViewButton, sectionId !== 'Config-Info');
12141212
12151213 $ConfigInfo.hide();
1216 $ConfigAbout.hide();
12171214
12181215 if (sectionId === 'Search')
12191216 {
12271224 {
12281225 $ConfigInfo.show();
12291226 $ConfigData.children().hide();
1230 $ConfigTitle.text('INFO: SETTINGS');
1231 return;
1232 }
1233
1234 if (sectionId === 'Config-About')
1235 {
1236 $ConfigAbout.show();
1237 $ConfigData.children().hide();
1238 $ConfigTitle.text('NZBGET ' + Options.option('version'));
1227 $ConfigTitle.text('INFO');
12391228 return;
12401229 }
12411230
682682 function itemCheckClick(data, event)
683683 {
684684 var checkmark = $(event.target).hasClass('check');
685 if (data.dragging || (!checkmark && !data.config.rowSelect))
685 if (data.dragging || (!checkmark && !data.config.rowSelect))
686686 {
687687 return;
688688 }
711711 function titleCheckClick(data, event)
712712 {
713713 var checkmark = $(event.target).hasClass('check');
714 if (data.dragging || (!checkmark && !data.config.rowSelect))
714 if (data.dragging || (!checkmark && !data.config.rowSelect))
715715 {
716716 return;
717717 }
537537 <div class="span3">
538538 <ul class="nav nav-list" id="ConfigNav">
539539 <li class="config-static"><a href="#Config-Info">INFO</a></li>
540 <li class="config-static"><a href="#Config-About">ABOUT NZBGET</a></li>
541540 <li class="config-static"><a href="#Config-System">SYSTEM</a></li>
542541 </ul>
543542 </div>
546545 <div>
547546
548547 <div class="config-header clearfix">
549 <div class="pull-left" id="ConfigTitle">INFO: SETTINGS</div>
548 <div class="pull-left" id="ConfigTitle">INFO</div>
550549 <div class="btn-group pull-right">
551550 <a class="btn dropdown-toggle" id="Config_ViewButton" data-toggle="dropdown">View <span class="caret"></span></a>
552551 <ul class="dropdown-menu footer-button-menu" id="Config_ViewMenu">
568567 When you configure NZBGet for the first time you need
569568 to check at least the option <a class="option" href="#" data-category="S" onclick="Config.scrollToOption(event, this)">MainDir</a> and configure one news server.
570569 </p>
571 <p>
572 There are many configuration options affecting performance. If you use
573 NZBGet on a computer with limited capabilities, such as NAS, media player,
574 router, etc. you should take your time to configure NZBGet for best
575 performance - see <a href="http://nzbget.net/performance-tips">Performance tips</a>.
576 </p>
577570
578571 <h4>Extension scripts settings</h4>
579572 <p>
594587 <p>
595588 This can be done in section <em><strong>SYSTEM</strong></em>.
596589 </p>
597 </div>
598
599 <div id="ConfigAbout">
600 <p>For info on NZBGet project please visit <a href="http://nzbget.net">NZBGet Home Page</a>. Among other things the developers of third-party apps find there complete docs about RPC interface.</p>
601 <p>Should you need help, have suggestions or want to share your improvements - <a href="http://nzbget.net/forum">NZBGet Forum</a> is a place to do that.</p>
602590
603591 <h4>Copyright</h4>
604592 <p>This program is free software; you can redistribute it and/or modify
171171 {
172172 var inp = $('#AddDialog_Input');
173173
174 // Reset file input control; needed for IE10 but produce problems with opera (the old non-webkit one).
175 if ($.browser.msie)
176 {
177 inp.wrap('<form>').closest('form').get(0).reset();
178 inp.unwrap();
179 }
180
174 // Reset file input control
175 inp.val('');
176
181177 inp.click();
182178 }
183179