Skip to content

Commit

Permalink
Version 0.10.3, 22.02.2016:
Browse files Browse the repository at this point in the history
- Fixed bug with opening files as read-only
- Updated OpenSSL to 1.0.2f, boost to 1.60.0
  • Loading branch information
rhiestan committed Feb 22, 2016
1 parent 94c7289 commit e2b5c73
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 11 deletions.
33 changes: 25 additions & 8 deletions src/pfm_layer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -811,7 +811,7 @@ int/*error*/ CCALL PFMLayer::List(int64_t openId,int64_t listId,PfmMarshallerLis
boost::shared_ptr<DirTraverse> pDirTTemp ( new DirTraverse(dirT) );
fl.pDirT_ = pDirTTemp;
pOpenFile->fileLists_.push_back(fl);
pFileList = &fl;
pFileList = &(pOpenFile->fileLists_.back());
}
catch( rlog::Error &err )
{
Expand All @@ -820,6 +820,16 @@ int/*error*/ CCALL PFMLayer::List(int64_t openId,int64_t listId,PfmMarshallerLis
}
}

// Process result from previous call
if(pFileList->hasPreviousResult_)
{
uint8_t wasAdded = 1;
listResult->Add8(&(pFileList->prevAttribs_), pFileList->prevName_.c_str(), &wasAdded);

if(wasAdded)
pFileList->hasPreviousResult_ = false;
}

bool doCont = true;
while(doCont)
{
Expand Down Expand Up @@ -852,7 +862,7 @@ int/*error*/ CCALL PFMLayer::List(int64_t openId,int64_t listId,PfmMarshallerLis

if( !fileStatCache_.stat(cpath.c_str(), &buf) ) //fs_layer::lstat( cpath.c_str(), &buf ))
{
uint8_t needMore = 1;
uint8_t wasAdded = 1;
PfmAttribs attribs;
bool skipThisFile = false;

Expand Down Expand Up @@ -924,10 +934,17 @@ int/*error*/ CCALL PFMLayer::List(int64_t openId,int64_t listId,PfmMarshallerLis
attribs.changeTime = UnixTimeToFileTime(buf.st_mtime);

if(!skipThisFile)
listResult->Add8(&attribs, name.c_str(), &needMore);
listResult->Add8(&attribs, name.c_str(), &wasAdded);

if(!needMore)
if(!wasAdded)
{
doCont = false;

// Save current result for later
pFileList->hasPreviousResult_ = true;
pFileList->prevAttribs_ = attribs;
pFileList->prevName_ = name;
}
}
else
{
Expand Down Expand Up @@ -1725,9 +1742,9 @@ int PFMLayer::makeOpenFileFlags(PT_INT8 accessLevel)
#endif

#if defined(_WIN32)
int flags = O_BINARY | O_RDWR;
int flags = O_BINARY;
#else
int flags = O_RDWR;
int flags = 0;
#endif

if(accessLevel >= pfmAccessLevelWriteData)
Expand All @@ -1745,9 +1762,9 @@ int PFMLayer::makeOpenFileFlags(bool isReadOnly)
#endif

#if defined(_WIN32)
int flags = O_BINARY | O_RDWR;
int flags = O_BINARY;
#else
int flags = O_RDWR;
int flags = 0;
#endif

if(isReadOnly)
Expand Down
10 changes: 9 additions & 1 deletion src/pfm_layer.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,17 @@ class PFMLayer: public PfmFormatterOps
class FileList
{
public:
FileList(): listId_(0) { }
FileList(): listId_(0), hasPreviousResult_(false) { }
FileList(const FileList &o) { copy(o); }
virtual ~FileList() { }
FileList &copy(const FileList &o)
{
listId_ = o.listId_;
pDirT_ = o.pDirT_;
hasPreviousResult_ = o.hasPreviousResult_;
prevAttribs_ = o.prevAttribs_;
prevName_ = o.prevName_;

return *this;
}
FileList & operator=(const FileList & o)
Expand All @@ -107,6 +111,10 @@ class PFMLayer: public PfmFormatterOps

int64_t listId_;
boost::shared_ptr<DirTraverse> pDirT_;

bool hasPreviousResult_;
PfmAttribs prevAttribs_;
std::string prevName_;
};

/**
Expand Down
4 changes: 2 additions & 2 deletions src/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@

#define ENCFSMP_VERSION_MAJOR 0
#define ENCFSMP_VERSION_MINOR 10
#define ENCFSMP_VERSION_BUILD 1
#define ENCFSMP_VERSION_BUILD 3

#define ENCFSMP_VERSION_STRING EFS_STRINGIFY(ENCFSMP_VERSION_MAJOR) \
"." EFS_STRINGIFY(ENCFSMP_VERSION_MINOR) \
"." EFS_STRINGIFY(ENCFSMP_VERSION_BUILD)

#define ENCFSMP_NAME "EncFS MP"
#define ENCFSMP_COPYRIGHT_NAME "Roman Hiestand"
#define ENCFSMP_COPYRIGHT_YEAR "2015"
#define ENCFSMP_COPYRIGHT_YEAR "2016"

// The check for __INTEL_COMPILER needs to be before _MSC_VER and __GNUG__, as
// the Intel compiler defines _MSC_VER and __GNUG__ as well
Expand Down
9 changes: 9 additions & 0 deletions version.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
Version history
---------------

Version 0.10.3, 22.02.2016:
- Fixed bug with opening files as read-only
- Updated OpenSSL to 1.0.2f, boost to 1.60.0


Version 0.10.2, 07.01.2016:
- Fixed directory listing of directories with more than 1100 entries (ticket #43)


Version 0.10.1, 27.11.2015:
- Date bug fixed in 32 bit version (ticket #40)
- Updated PFM to 1.0.0.180 (fixes ticket #34)
Expand Down

0 comments on commit e2b5c73

Please sign in to comment.