Loading mtp/MtpServer.cpp +4 −2 Original line number Diff line number Diff line Loading @@ -1078,9 +1078,11 @@ MtpResponseCode MtpServer::doSendObject() { unlink(mSendObjectFilePath); if (errno == ECANCELED) result = MTP_RESPONSE_TRANSACTION_CANCELLED; else else { MTPD("errno: %d\n", errno); result = MTP_RESPONSE_GENERAL_ERROR; } } done: // reset so we don't attempt to send the data back Loading @@ -1093,7 +1095,7 @@ done: mSendObjectHandle = kInvalidObjectHandle; MTPD("result: %d\n", result); mSendObjectFormat = 0; return MTP_RESPONSE_OK; return result; } static void deleteRecursive(const char* path) { Loading mtp/mtp_MtpServer.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -123,7 +123,7 @@ void twmtp_MtpServer::add_storage() int storageID = stores->at(i)->mtpid; long reserveSpace = 1; bool removable = false; long maxFileSize = 1000000000L; long maxFileSize = stores->at(i)->maxFileSize; if (descriptionStr != "") { MtpStorage* storage = new MtpStorage(storageID, &pathStr[0], &descriptionStr[0], reserveSpace, removable, maxFileSize, refserver); server->addStorage(storage); Loading mtp/mtp_MtpServer.hpp +1 −0 Original line number Diff line number Diff line Loading @@ -36,6 +36,7 @@ typedef struct Storage { std::string display; std::string mount; int mtpid; uint64_t maxFileSize; } storage; typedef std::vector<storage*> storages; Loading mtp/twrpMtp.cpp +2 −1 Original line number Diff line number Diff line Loading @@ -107,11 +107,12 @@ pid_t twrpMtp::forkserver(void) { return 0; } void twrpMtp::addStorage(std::string display, std::string path, int mtpid) { void twrpMtp::addStorage(std::string display, std::string path, int mtpid, uint64_t maxFileSize) { s = new storage; s->display = display; s->mount = path; s->mtpid = mtpid; s->maxFileSize = maxFileSize; MTPD("twrpMtp mtpid: %d\n", s->mtpid); mtpstorages->push_back(s); } mtp/twrpMtp.hpp +1 −1 Original line number Diff line number Diff line Loading @@ -36,7 +36,7 @@ class twrpMtp { twrpMtp(int debug_enabled /* = 0 */); pthread_t threadserver(void); pid_t forkserver(void); void addStorage(std::string display, std::string path, int mtpid); void addStorage(std::string display, std::string path, int mtpid, uint64_t maxFileSize); private: int start(void); typedef int (twrpMtp::*ThreadPtr)(void); Loading Loading
mtp/MtpServer.cpp +4 −2 Original line number Diff line number Diff line Loading @@ -1078,9 +1078,11 @@ MtpResponseCode MtpServer::doSendObject() { unlink(mSendObjectFilePath); if (errno == ECANCELED) result = MTP_RESPONSE_TRANSACTION_CANCELLED; else else { MTPD("errno: %d\n", errno); result = MTP_RESPONSE_GENERAL_ERROR; } } done: // reset so we don't attempt to send the data back Loading @@ -1093,7 +1095,7 @@ done: mSendObjectHandle = kInvalidObjectHandle; MTPD("result: %d\n", result); mSendObjectFormat = 0; return MTP_RESPONSE_OK; return result; } static void deleteRecursive(const char* path) { Loading
mtp/mtp_MtpServer.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -123,7 +123,7 @@ void twmtp_MtpServer::add_storage() int storageID = stores->at(i)->mtpid; long reserveSpace = 1; bool removable = false; long maxFileSize = 1000000000L; long maxFileSize = stores->at(i)->maxFileSize; if (descriptionStr != "") { MtpStorage* storage = new MtpStorage(storageID, &pathStr[0], &descriptionStr[0], reserveSpace, removable, maxFileSize, refserver); server->addStorage(storage); Loading
mtp/mtp_MtpServer.hpp +1 −0 Original line number Diff line number Diff line Loading @@ -36,6 +36,7 @@ typedef struct Storage { std::string display; std::string mount; int mtpid; uint64_t maxFileSize; } storage; typedef std::vector<storage*> storages; Loading
mtp/twrpMtp.cpp +2 −1 Original line number Diff line number Diff line Loading @@ -107,11 +107,12 @@ pid_t twrpMtp::forkserver(void) { return 0; } void twrpMtp::addStorage(std::string display, std::string path, int mtpid) { void twrpMtp::addStorage(std::string display, std::string path, int mtpid, uint64_t maxFileSize) { s = new storage; s->display = display; s->mount = path; s->mtpid = mtpid; s->maxFileSize = maxFileSize; MTPD("twrpMtp mtpid: %d\n", s->mtpid); mtpstorages->push_back(s); }
mtp/twrpMtp.hpp +1 −1 Original line number Diff line number Diff line Loading @@ -36,7 +36,7 @@ class twrpMtp { twrpMtp(int debug_enabled /* = 0 */); pthread_t threadserver(void); pid_t forkserver(void); void addStorage(std::string display, std::string path, int mtpid); void addStorage(std::string display, std::string path, int mtpid, uint64_t maxFileSize); private: int start(void); typedef int (twrpMtp::*ThreadPtr)(void); Loading