mirror of
https://github.com/wiiu-env/ftpiiu_plugin.git
synced 2024-10-01 04:29:56 +02:00
Compare commits
No commits in common. "b32f397969ec1afcba9ab5f99a3335903e3bfdae" and "cfd9c6c801f9af711d048a01852e1e533fb47e60" have entirely different histories.
b32f397969
...
cfd9c6c801
10
.github/dependabot.yml
vendored
10
.github/dependabot.yml
vendored
@ -1,10 +0,0 @@
|
|||||||
version: 2
|
|
||||||
updates:
|
|
||||||
- package-ecosystem: "docker"
|
|
||||||
directory: "/"
|
|
||||||
schedule:
|
|
||||||
interval: "daily"
|
|
||||||
- package-ecosystem: "github-actions"
|
|
||||||
directory: "/"
|
|
||||||
schedule:
|
|
||||||
interval: "daily"
|
|
6
.github/workflows/ci.yml
vendored
6
.github/workflows/ci.yml
vendored
@ -9,7 +9,7 @@ jobs:
|
|||||||
clang-format:
|
clang-format:
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v3
|
||||||
- name: clang-format
|
- name: clang-format
|
||||||
run: |
|
run: |
|
||||||
docker run --rm -v ${PWD}:/src ghcr.io/wiiu-env/clang-format:13.0.0-2 -r ./source ./include
|
docker run --rm -v ${PWD}:/src ghcr.io/wiiu-env/clang-format:13.0.0-2 -r ./source ./include
|
||||||
@ -17,7 +17,7 @@ jobs:
|
|||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
needs: clang-format
|
needs: clang-format
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v3
|
||||||
- name: create version.h
|
- name: create version.h
|
||||||
run: |
|
run: |
|
||||||
git_hash=$(git rev-parse --short "$GITHUB_SHA")
|
git_hash=$(git rev-parse --short "$GITHUB_SHA")
|
||||||
@ -48,7 +48,7 @@ jobs:
|
|||||||
- name: zip artifact
|
- name: zip artifact
|
||||||
run: zip -r ${{ env.REPOSITORY_NAME }}_${{ env.DATETIME }}.zip *.wps
|
run: zip -r ${{ env.REPOSITORY_NAME }}_${{ env.DATETIME }}.zip *.wps
|
||||||
- name: Create Release
|
- name: Create Release
|
||||||
uses: "softprops/action-gh-release@v2"
|
uses: "softprops/action-gh-release@v1"
|
||||||
with:
|
with:
|
||||||
tag_name: ${{ env.REPOSITORY_NAME }}-${{ env.DATETIME }}
|
tag_name: ${{ env.REPOSITORY_NAME }}-${{ env.DATETIME }}
|
||||||
draft: false
|
draft: false
|
||||||
|
4
.github/workflows/pr.yml
vendored
4
.github/workflows/pr.yml
vendored
@ -6,7 +6,7 @@ jobs:
|
|||||||
clang-format:
|
clang-format:
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v3
|
||||||
- name: clang-format
|
- name: clang-format
|
||||||
run: |
|
run: |
|
||||||
docker run --rm -v ${PWD}:/src ghcr.io/wiiu-env/clang-format:13.0.0-2 -r ./source ./include
|
docker run --rm -v ${PWD}:/src ghcr.io/wiiu-env/clang-format:13.0.0-2 -r ./source ./include
|
||||||
@ -14,7 +14,7 @@ jobs:
|
|||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
needs: clang-format
|
needs: clang-format
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v3
|
||||||
- name: create version.h
|
- name: create version.h
|
||||||
run: |
|
run: |
|
||||||
git_hash=$(git rev-parse --short "${{ github.event.pull_request.head.sha }}")
|
git_hash=$(git rev-parse --short "${{ github.event.pull_request.head.sha }}")
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
FROM ghcr.io/wiiu-env/devkitppc:20240423
|
FROM ghcr.io/wiiu-env/devkitppc:20231112
|
||||||
|
|
||||||
COPY --from=ghcr.io/wiiu-env/wiiupluginsystem:20240425 /artifacts $DEVKITPRO
|
COPY --from=ghcr.io/wiiu-env/wiiupluginsystem:0.8.0-dev-20240302-3b5cc2f /artifacts $DEVKITPRO
|
||||||
COPY --from=ghcr.io/wiiu-env/libmocha:20231127 /artifacts $DEVKITPRO
|
COPY --from=ghcr.io/wiiu-env/libmocha:20231127 /artifacts $DEVKITPRO
|
||||||
|
|
||||||
WORKDIR project
|
WORKDIR project
|
@ -27,7 +27,7 @@
|
|||||||
/// \brief Log level
|
/// \brief Log level
|
||||||
enum LogLevel
|
enum LogLevel
|
||||||
{
|
{
|
||||||
DEBUGLOG,
|
DEBUG,
|
||||||
INFO,
|
INFO,
|
||||||
ERROR,
|
ERROR,
|
||||||
COMMAND,
|
COMMAND,
|
||||||
|
@ -31,9 +31,6 @@ public:
|
|||||||
}
|
}
|
||||||
mDir = {};
|
mDir = {};
|
||||||
snprintf (mDir.d_name, sizeof (mDir.d_name), "%s", mCurIterator->c_str ());
|
snprintf (mDir.d_name, sizeof (mDir.d_name), "%s", mCurIterator->c_str ());
|
||||||
#ifdef _DIRENT_HAVE_D_STAT
|
|
||||||
mDir.d_stat.st_mode = _IFDIR;
|
|
||||||
#endif
|
|
||||||
mCurIterator++;
|
mCurIterator++;
|
||||||
mDirPtr.position++;
|
mDirPtr.position++;
|
||||||
return &mDir;
|
return &mDir;
|
||||||
|
@ -1637,6 +1637,44 @@ void FtpSession::sendResponse (std::string_view const response_)
|
|||||||
m_responseBuffer.markUsed (response_.size ());
|
m_responseBuffer.markUsed (response_.size ());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef __WIIU__
|
||||||
|
#ifndef FSA_DIRITER_MAGIC
|
||||||
|
#define FSA_DIRITER_MAGIC 0x77696975
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// TODO: make this less hacky. Ideally this should be handled by newlib.
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
uint32_t magic;
|
||||||
|
FSADirectoryHandle fd;
|
||||||
|
FSADirectoryEntry entry_data;
|
||||||
|
// Some fields are missing here!!!!
|
||||||
|
} __wut_fsa_dir_incomplete_t;
|
||||||
|
|
||||||
|
extern "C" void __wut_fsa_translate_stat (FSAClientHandle clientHandle,
|
||||||
|
FSStat *fsStat,
|
||||||
|
ino_t ino,
|
||||||
|
struct stat *posStat);
|
||||||
|
|
||||||
|
static bool __wut_fsa_get_stat_from_dir (DIR *dp, struct stat *posStat)
|
||||||
|
{
|
||||||
|
if (dp == NULL || dp->dirData == NULL || dp->dirData->dirStruct == NULL || posStat == NULL)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
auto const magic = *(uint32_t *)(dp->dirData->dirStruct);
|
||||||
|
if (magic == FSA_DIRITER_MAGIC)
|
||||||
|
{
|
||||||
|
__wut_fsa_dir_incomplete_t *dir = (__wut_fsa_dir_incomplete_t *)dp->dirData->dirStruct;
|
||||||
|
__wut_fsa_translate_stat (0, &dir->entry_data.info, 0, posStat);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
bool FtpSession::listTransfer ()
|
bool FtpSession::listTransfer ()
|
||||||
{
|
{
|
||||||
// check if we sent all available data
|
// check if we sent all available data
|
||||||
@ -1692,20 +1730,114 @@ bool FtpSession::listTransfer ()
|
|||||||
{
|
{
|
||||||
// build the path
|
// build the path
|
||||||
auto const fullPath = buildPath (m_lwd, dent->d_name);
|
auto const fullPath = buildPath (m_lwd, dent->d_name);
|
||||||
auto const path = encodePath (dent->d_name);
|
struct stat st = {};
|
||||||
#ifdef _DIRENT_HAVE_D_STAT
|
#ifdef __WIIU__
|
||||||
auto const rc = fillDirent (dent->d_stat, path);
|
auto const dp = static_cast<DIR *> (m_dir);
|
||||||
#else
|
if (__wut_fsa_get_stat_from_dir (dp, &st))
|
||||||
struct stat st = {};
|
|
||||||
// lstat the entry
|
|
||||||
if (IOAbstraction::lstat (fullPath.c_str (), &st) != 0)
|
|
||||||
{
|
{
|
||||||
sendResponse ("550 %s\r\n", std::strerror (errno));
|
// success!
|
||||||
setState (State::COMMAND, true, true);
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
auto const rc = fillDirent (st, path);
|
else
|
||||||
|
{ // fallback to lstat
|
||||||
|
#elifdef __3DS__
|
||||||
|
// the sdmc directory entry already has the type and size, so no need to do a slow stat
|
||||||
|
auto const dp = static_cast<DIR *> (m_dir);
|
||||||
|
auto const magic = *reinterpret_cast<u32 *> (dp->dirData->dirStruct);
|
||||||
|
|
||||||
|
if (magic == ARCHIVE_DIRITER_MAGIC)
|
||||||
|
{
|
||||||
|
auto const dir = reinterpret_cast<archive_dir_t const *> (dp->dirData->dirStruct);
|
||||||
|
auto const entry = &dir->entry_data[dir->index];
|
||||||
|
|
||||||
|
if (entry->attributes & FS_ATTRIBUTE_DIRECTORY)
|
||||||
|
st.st_mode = S_IFDIR | S_IRUSR | S_IRGRP | S_IROTH;
|
||||||
|
else
|
||||||
|
st.st_mode = S_IFREG | S_IRUSR | S_IRGRP | S_IROTH;
|
||||||
|
|
||||||
|
if (!(entry->attributes & FS_ATTRIBUTE_READ_ONLY))
|
||||||
|
st.st_mode |= S_IWUSR | S_IWGRP | S_IWOTH;
|
||||||
|
|
||||||
|
st.st_size = entry->fileSize;
|
||||||
|
st.st_mtime = 0;
|
||||||
|
|
||||||
|
bool getmtime = true;
|
||||||
|
if (m_xferDirMode == XferDirMode::MLSD || m_xferDirMode == XferDirMode::MLST)
|
||||||
|
{
|
||||||
|
if (!m_mlstModify)
|
||||||
|
getmtime = false;
|
||||||
|
}
|
||||||
|
else if (m_xferDirMode == XferDirMode::NLST)
|
||||||
|
getmtime = false;
|
||||||
|
|
||||||
|
{
|
||||||
|
auto const lock = m_config.lockGuard ();
|
||||||
|
if (!m_config.getMTime ())
|
||||||
|
getmtime = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (getmtime)
|
||||||
|
{
|
||||||
|
std::uint64_t mtime = 0;
|
||||||
|
auto const rc = archive_getmtime (fullPath.c_str (), &mtime);
|
||||||
|
if (rc != 0)
|
||||||
|
error ("sdmc_getmtime %s 0x%lx\n", fullPath.c_str (), rc);
|
||||||
|
else
|
||||||
|
st.st_mtime = mtime;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
#endif
|
#endif
|
||||||
|
// lstat the entry
|
||||||
|
if (IOAbstraction::lstat (fullPath.c_str (), &st) != 0)
|
||||||
|
{
|
||||||
|
#ifndef __SWITCH__
|
||||||
|
sendResponse ("550 %s\r\n", std::strerror (errno));
|
||||||
|
setState (State::COMMAND, true, true);
|
||||||
|
return false;
|
||||||
|
#else
|
||||||
|
// probably archive bit set; list name with dummy stats
|
||||||
|
std::memset (&st, 0, sizeof (st));
|
||||||
|
error ("%s: type %u\n", dent->d_name, dent->d_type);
|
||||||
|
switch (dent->d_type)
|
||||||
|
{
|
||||||
|
case DT_BLK:
|
||||||
|
st.st_mode = S_IFBLK;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case DT_CHR:
|
||||||
|
st.st_mode = S_IFCHR;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case DT_DIR:
|
||||||
|
st.st_mode = S_IFDIR;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case DT_FIFO:
|
||||||
|
st.st_mode = S_IFIFO;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case DT_LNK:
|
||||||
|
st.st_mode = S_IFLNK;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case DT_REG:
|
||||||
|
case DT_UNKNOWN:
|
||||||
|
st.st_mode = S_IFREG;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case DT_SOCK:
|
||||||
|
st.st_mode = S_IFSOCK;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
#if defined(__WIIU__) || defined(__3DS__)
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
auto const path = encodePath (dent->d_name);
|
||||||
|
auto const rc = fillDirent (st, path);
|
||||||
if (rc != 0)
|
if (rc != 0)
|
||||||
{
|
{
|
||||||
sendResponse ("425 %s\r\n", std::strerror (errno));
|
sendResponse ("425 %s\r\n", std::strerror (errno));
|
||||||
@ -2211,7 +2343,7 @@ void FtpSession::PASV (char const *args_)
|
|||||||
ephemeralPort = 5001;
|
ephemeralPort = 5001;
|
||||||
addr.sin_port = htons (ephemeralPort++);
|
addr.sin_port = htons (ephemeralPort++);
|
||||||
#else
|
#else
|
||||||
addr.sin_port = htons (0);
|
addr.sin_port = htons (0);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// bind to the address
|
// bind to the address
|
||||||
|
@ -50,7 +50,7 @@ bool s_logUpdated = true;
|
|||||||
|
|
||||||
/// \brief Message prefix
|
/// \brief Message prefix
|
||||||
static char const *const s_prefix[] = {
|
static char const *const s_prefix[] = {
|
||||||
[DEBUGLOG] = "[DEBUG]",
|
[DEBUG] = "[DEBUG]",
|
||||||
[INFO] = "[INFO]",
|
[INFO] = "[INFO]",
|
||||||
[ERROR] = "[ERROR]",
|
[ERROR] = "[ERROR]",
|
||||||
[COMMAND] = "[COMMAND]",
|
[COMMAND] = "[COMMAND]",
|
||||||
@ -114,7 +114,7 @@ void drawLog ()
|
|||||||
|
|
||||||
#ifdef CLASSIC
|
#ifdef CLASSIC
|
||||||
char const *const s_colors[] = {
|
char const *const s_colors[] = {
|
||||||
[DEBUGLOG] = "\x1b[33;1m", // yellow
|
[DEBUG] = "\x1b[33;1m", // yellow
|
||||||
[INFO] = "\x1b[37;1m", // white
|
[INFO] = "\x1b[37;1m", // white
|
||||||
[ERROR] = "\x1b[31;1m", // red
|
[ERROR] = "\x1b[31;1m", // red
|
||||||
[COMMAND] = "\x1b[32;1m", // green
|
[COMMAND] = "\x1b[32;1m", // green
|
||||||
@ -204,7 +204,7 @@ void debug (char const *const fmt_, ...)
|
|||||||
va_list ap;
|
va_list ap;
|
||||||
|
|
||||||
va_start (ap, fmt_);
|
va_start (ap, fmt_);
|
||||||
addLog (DEBUGLOG, fmt_, ap);
|
addLog (DEBUG, fmt_, ap);
|
||||||
va_end (ap);
|
va_end (ap);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -1,42 +0,0 @@
|
|||||||
#ifdef DEBUG
|
|
||||||
#include <stdint.h>
|
|
||||||
#include <whb/log_cafe.h>
|
|
||||||
#include <whb/log_module.h>
|
|
||||||
#include <whb/log_udp.h>
|
|
||||||
|
|
||||||
uint32_t moduleLogInit = false;
|
|
||||||
uint32_t cafeLogInit = false;
|
|
||||||
uint32_t udpLogInit = false;
|
|
||||||
#endif // DEBUG
|
|
||||||
|
|
||||||
void initLogging ()
|
|
||||||
{
|
|
||||||
#ifdef DEBUG
|
|
||||||
if (!(moduleLogInit = WHBLogModuleInit ()))
|
|
||||||
{
|
|
||||||
cafeLogInit = WHBLogCafeInit ();
|
|
||||||
udpLogInit = WHBLogUdpInit ();
|
|
||||||
}
|
|
||||||
#endif // DEBUG
|
|
||||||
}
|
|
||||||
|
|
||||||
void deinitLogging ()
|
|
||||||
{
|
|
||||||
#ifdef DEBUG
|
|
||||||
if (moduleLogInit)
|
|
||||||
{
|
|
||||||
WHBLogModuleDeinit ();
|
|
||||||
moduleLogInit = false;
|
|
||||||
}
|
|
||||||
if (cafeLogInit)
|
|
||||||
{
|
|
||||||
WHBLogCafeDeinit ();
|
|
||||||
cafeLogInit = false;
|
|
||||||
}
|
|
||||||
if (udpLogInit)
|
|
||||||
{
|
|
||||||
WHBLogUdpDeinit ();
|
|
||||||
udpLogInit = false;
|
|
||||||
}
|
|
||||||
#endif // DEBUG
|
|
||||||
}
|
|
@ -1,67 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#include <coreinit/debug.h>
|
|
||||||
#include <string.h>
|
|
||||||
#include <whb/log.h>
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define LOG_APP_TYPE "P"
|
|
||||||
#define LOG_APP_NAME "homebrew_on_menu"
|
|
||||||
|
|
||||||
#define __FILENAME_X__ (strrchr (__FILE__, '\\') ? strrchr (__FILE__, '\\') + 1 : __FILE__)
|
|
||||||
#define __FILENAME__ (strrchr (__FILE__, '/') ? strrchr (__FILE__, '/') + 1 : __FILENAME_X__)
|
|
||||||
|
|
||||||
#define LOG(LOG_FUNC, FMT, ARGS...) LOG_EX (LOG_FUNC, "", "", FMT, ##ARGS)
|
|
||||||
|
|
||||||
#define LOG_EX(LOG_FUNC, LOG_LEVEL, LINE_END, FMT, ARGS...) \
|
|
||||||
do \
|
|
||||||
{ \
|
|
||||||
LOG_FUNC ("[(%s)%18s][%23s]%30s@L%04d: " LOG_LEVEL "" FMT "" LINE_END, \
|
|
||||||
LOG_APP_TYPE, \
|
|
||||||
LOG_APP_NAME, \
|
|
||||||
__FILENAME__, \
|
|
||||||
__FUNCTION__, \
|
|
||||||
__LINE__, \
|
|
||||||
##ARGS); \
|
|
||||||
} while (0)
|
|
||||||
|
|
||||||
#ifdef DEBUG
|
|
||||||
|
|
||||||
#ifdef VERBOSE_DEBUG
|
|
||||||
#define DEBUG_FUNCTION_LINE_VERBOSE(FMT, ARGS...) LOG (WHBLogPrintf, FMT, ##ARGS)
|
|
||||||
#else
|
|
||||||
#define DEBUG_FUNCTION_LINE_VERBOSE(FMT, ARGS...) while (0)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define DEBUG_FUNCTION_LINE(FMT, ARGS...) LOG (WHBLogPrintf, FMT, ##ARGS)
|
|
||||||
|
|
||||||
#define DEBUG_FUNCTION_LINE_WRITE(FMT, ARGS...) LOG (WHBLogWritef, FMT, ##ARGS)
|
|
||||||
|
|
||||||
#define DEBUG_FUNCTION_LINE_ERR(FMT, ARGS...) LOG_EX (WHBLogPrintf, "##ERROR## ", "", FMT, ##ARGS)
|
|
||||||
#define DEBUG_FUNCTION_LINE_WARN(FMT, ARGS...) LOG_EX (WHBLogPrintf, "##WARN ## ", "", FMT, ##ARGS)
|
|
||||||
#define DEBUG_FUNCTION_LINE_INFO(FMT, ARGS...) LOG_EX (WHBLogPrintf, "##INFO ## ", "", FMT, ##ARGS)
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
#define DEBUG_FUNCTION_LINE_VERBOSE(FMT, ARGS...) while (0)
|
|
||||||
|
|
||||||
#define DEBUG_FUNCTION_LINE(FMT, ARGS...) while (0)
|
|
||||||
|
|
||||||
#define DEBUG_FUNCTION_LINE_WRITE(FMT, ARGS...) while (0)
|
|
||||||
|
|
||||||
#define DEBUG_FUNCTION_LINE_ERR(FMT, ARGS...) LOG_EX (OSReport, "##ERROR## ", "\n", FMT, ##ARGS)
|
|
||||||
#define DEBUG_FUNCTION_LINE_WARN(FMT, ARGS...) LOG_EX (OSReport, "##WARN ## ", "\n", FMT, ##ARGS)
|
|
||||||
#define DEBUG_FUNCTION_LINE_INFO(FMT, ARGS...) LOG_EX (OSReport, "##INFO ## ", "\n", FMT, ##ARGS)
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void initLogging ();
|
|
||||||
|
|
||||||
void deinitLogging ();
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
@ -24,7 +24,6 @@
|
|||||||
#include "IOAbstraction.h"
|
#include "IOAbstraction.h"
|
||||||
#include "ftpServer.h"
|
#include "ftpServer.h"
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
#include "logger.h"
|
|
||||||
|
|
||||||
#include <mocha/mocha.h>
|
#include <mocha/mocha.h>
|
||||||
#include <nn/ac.h>
|
#include <nn/ac.h>
|
||||||
@ -41,7 +40,7 @@
|
|||||||
#ifndef CLASSIC
|
#ifndef CLASSIC
|
||||||
#error "Wii U must be built in classic mode"
|
#error "Wii U must be built in classic mode"
|
||||||
#endif
|
#endif
|
||||||
#define VERSION "v0.4.0"
|
#define VERSION "v0.4.1"
|
||||||
#define VERSION_FULL VERSION VERSION_EXTRA
|
#define VERSION_FULL VERSION VERSION_EXTRA
|
||||||
|
|
||||||
WUPS_PLUGIN_NAME ("ftpiiu");
|
WUPS_PLUGIN_NAME ("ftpiiu");
|
||||||
@ -87,8 +86,7 @@ MochaUtilsStatus MountWrapper (const char *mount, const char *dev, const char *m
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
DEBUG_FUNCTION_LINE_ERR (
|
error ("Failed to mount %s: %s [%d]", mount, Mocha_GetStatusStr (res), res);
|
||||||
"Failed to mount %s: %s [%d]", mount, Mocha_GetStatusStr (res), res);
|
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
@ -171,8 +169,7 @@ void start_server ()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
DEBUG_FUNCTION_LINE_ERR (
|
OSReport ("Failed to init libmocha: %s [%d]\n", Mocha_GetStatusStr (res), res);
|
||||||
"Failed to init libmocha: %s [%d]\n", Mocha_GetStatusStr (res), res);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
server = FtpServer::create ();
|
server = FtpServer::create ();
|
||||||
@ -212,7 +209,7 @@ static void gFTPServerRunningChanged (ConfigItemBoolean *item, bool newValue)
|
|||||||
auto res = WUPSStorageAPI::Store (FTPIIU_ENABLED_STRING, sFTPServerEnabled);
|
auto res = WUPSStorageAPI::Store (FTPIIU_ENABLED_STRING, sFTPServerEnabled);
|
||||||
if (res != WUPS_STORAGE_ERROR_SUCCESS)
|
if (res != WUPS_STORAGE_ERROR_SUCCESS)
|
||||||
{
|
{
|
||||||
DEBUG_FUNCTION_LINE_ERR ("Failed to store gFTPServerEnabled: %s (%d)\n",
|
OSReport ("Failed to store gFTPServerEnabled: %s (%d)\n",
|
||||||
WUPSStorageAPI::GetStatusStr (res).data (),
|
WUPSStorageAPI::GetStatusStr (res).data (),
|
||||||
res);
|
res);
|
||||||
}
|
}
|
||||||
@ -235,7 +232,7 @@ static void gSystemFilesAllowedChanged (ConfigItemBoolean *item, bool newValue)
|
|||||||
auto res = WUPSStorageAPI::Store (SYSTEM_FILES_ALLOWED_STRING, sSystemFilesAllowed);
|
auto res = WUPSStorageAPI::Store (SYSTEM_FILES_ALLOWED_STRING, sSystemFilesAllowed);
|
||||||
if (res != WUPS_STORAGE_ERROR_SUCCESS)
|
if (res != WUPS_STORAGE_ERROR_SUCCESS)
|
||||||
{
|
{
|
||||||
DEBUG_FUNCTION_LINE_ERR ("Failed to store gSystemFilesAllowed: %s (%d)\n",
|
OSReport ("Failed to store gSystemFilesAllowed: %s (%d)\n",
|
||||||
WUPSStorageAPI::GetStatusStr (res).data (),
|
WUPSStorageAPI::GetStatusStr (res).data (),
|
||||||
res);
|
res);
|
||||||
}
|
}
|
||||||
@ -303,7 +300,6 @@ INITIALIZE_PLUGIN ()
|
|||||||
if (WUPSConfigAPI_Init (configOptions, ConfigMenuOpenedCallback, ConfigMenuClosedCallback) !=
|
if (WUPSConfigAPI_Init (configOptions, ConfigMenuOpenedCallback, ConfigMenuClosedCallback) !=
|
||||||
WUPSCONFIG_API_RESULT_SUCCESS)
|
WUPSCONFIG_API_RESULT_SUCCESS)
|
||||||
{
|
{
|
||||||
DEBUG_FUNCTION_LINE_ERR ("Failed to init config api");
|
|
||||||
OSFatal ("ftpiiu plugin: Failed to init config api");
|
OSFatal ("ftpiiu plugin: Failed to init config api");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -312,7 +308,7 @@ INITIALIZE_PLUGIN ()
|
|||||||
FTPIIU_ENABLED_STRING, sFTPServerEnabled, DEFAULT_FTPIIU_ENABLED_VALUE)) !=
|
FTPIIU_ENABLED_STRING, sFTPServerEnabled, DEFAULT_FTPIIU_ENABLED_VALUE)) !=
|
||||||
WUPS_STORAGE_ERROR_SUCCESS)
|
WUPS_STORAGE_ERROR_SUCCESS)
|
||||||
{
|
{
|
||||||
DEBUG_FUNCTION_LINE_ERR ("Failed to get or create item \"%s\": %s (%d)\n",
|
OSReport ("ftpiiu plugin: Failed to get or create item \"%s\": %s (%d)\n",
|
||||||
FTPIIU_ENABLED_STRING,
|
FTPIIU_ENABLED_STRING,
|
||||||
WUPSStorageAPI_GetStatusStr (err),
|
WUPSStorageAPI_GetStatusStr (err),
|
||||||
err);
|
err);
|
||||||
@ -321,7 +317,7 @@ INITIALIZE_PLUGIN ()
|
|||||||
sSystemFilesAllowed,
|
sSystemFilesAllowed,
|
||||||
DEFAULT_SYSTEM_FILES_ALLOWED_VALUE)) != WUPS_STORAGE_ERROR_SUCCESS)
|
DEFAULT_SYSTEM_FILES_ALLOWED_VALUE)) != WUPS_STORAGE_ERROR_SUCCESS)
|
||||||
{
|
{
|
||||||
DEBUG_FUNCTION_LINE_ERR ("Failed to get or create item \"%s\": %s (%d)\n",
|
OSReport ("ftpiiu plugin: Failed to get or create item \"%s\": %s (%d)\n",
|
||||||
SYSTEM_FILES_ALLOWED_STRING,
|
SYSTEM_FILES_ALLOWED_STRING,
|
||||||
WUPSStorageAPI_GetStatusStr (err),
|
WUPSStorageAPI_GetStatusStr (err),
|
||||||
err);
|
err);
|
||||||
@ -329,8 +325,9 @@ INITIALIZE_PLUGIN ()
|
|||||||
|
|
||||||
if ((err = WUPSStorageAPI::SaveStorage ()) != WUPS_STORAGE_ERROR_SUCCESS)
|
if ((err = WUPSStorageAPI::SaveStorage ()) != WUPS_STORAGE_ERROR_SUCCESS)
|
||||||
{
|
{
|
||||||
DEBUG_FUNCTION_LINE_ERR (
|
OSReport ("ftpiiu plugin: Failed to save storage: %s (%d)\n",
|
||||||
"Failed to save storage: %s (%d)\n", WUPSStorageAPI_GetStatusStr (err), err);
|
WUPSStorageAPI_GetStatusStr (err),
|
||||||
|
err);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -346,7 +343,6 @@ void wiiu_init ()
|
|||||||
|
|
||||||
ON_APPLICATION_START ()
|
ON_APPLICATION_START ()
|
||||||
{
|
{
|
||||||
initLogging ();
|
|
||||||
nn::ac::Initialize ();
|
nn::ac::Initialize ();
|
||||||
nn::ac::ConnectAsync ();
|
nn::ac::ConnectAsync ();
|
||||||
|
|
||||||
@ -356,7 +352,6 @@ ON_APPLICATION_START ()
|
|||||||
ON_APPLICATION_ENDS ()
|
ON_APPLICATION_ENDS ()
|
||||||
{
|
{
|
||||||
stop_server ();
|
stop_server ();
|
||||||
deinitLogging ();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool platform::init ()
|
bool platform::init ()
|
||||||
|
Loading…
Reference in New Issue
Block a user