Skip to content

Commit

Permalink
* Fixed issue with MFS not sending enough fragments
Browse files Browse the repository at this point in the history
  • Loading branch information
jredmondson committed Sep 20, 2018
1 parent 6092f49 commit 8aedea0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
18 changes: 9 additions & 9 deletions scripts/linux/bundle.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ DEST_DIR=""
SOURCE_DIR=""
UNZIP=0
NEEDS_FIX=0
COMPRESS_LIST=""
COMPRESS_LIST=()

#while [ "$#" -gt 0 ];
#do
Expand Down Expand Up @@ -131,27 +131,27 @@ else
COMPRESS_LIST=${DEST_DIR}/datapackage.json

if [ -d ${SOURCE_DIR}/bin ]; then
COMPRESS_LIST="${COMPRESS_LIST} ${SOURCE_DIR}/bin"
COMPRESS_LIST+=("${SOURCE_DIR}/bin");
fi

if [ -d ${SOURCE_DIR}/data ]; then
COMPRESS_LIST="${COMPRESS_LIST} ${SOURCE_DIR}/data"
COMPRESS_LIST+=("${SOURCE_DIR}/data");
fi

if [ -d ${SOURCE_DIR}/doc ]; then
COMPRESS_LIST="${COMPRESS_LIST} ${SOURCE_DIR}/doc"
COMPRESS_LIST+=("${SOURCE_DIR}/doc");
fi

if [ -d ${SOURCE_DIR}/lib ]; then
COMPRESS_LIST="${COMPRESS_LIST} ${SOURCE_DIR}/lib"
COMPRESS_LIST+=("${SOURCE_DIR}/lib");
fi

if [ -d ${SOURCE_DIR}/scripts ]; then
COMPRESS_LIST="${COMPRESS_LIST} ${SOURCE_DIR}/scripts"
COMPRESS_LIST+=("${SOURCE_DIR}/scripts");
fi

if [ -d ${SOURCE_DIR}/src ]; then
COMPRESS_LIST="${COMPRESS_LIST} ${SOURCE_DIR}/src"
COMPRESS_LIST+=("${SOURCE_DIR}/src");
fi

IFS=" "
Expand All @@ -172,8 +172,8 @@ else
FILE=${DEST_DIR}/${FILE}
fi

echo "tar ${TAR_ARGS} ${FILE} ${COMPRESS_LIST}"
tar ${TAR_ARGS} ${FILE} ${COMPRESS_LIST} --exclude=1
echo "tar ${TAR_ARGS} ${FILE} ${COMPRESS_LIST[@]}"
tar ${TAR_ARGS} ${FILE} "${COMPRESS_LIST[@]}" </dev/null
else
if [ "$FILE" = "bundle" ]; then
FILE="$FILE.gz"
Expand Down
5 changes: 5 additions & 0 deletions tools/mfs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,11 @@ void send_file (knowledge::KnowledgeBase & kb,

size_t num_fragments = streamer.get_size () / 60000;

if (streamer.get_size () % 60000 > 0)
{
num_fragments++;
}

madara_logger_ptr_log (
logger::global_logger.get (),
logger::LOG_ALWAYS,
Expand Down

0 comments on commit 8aedea0

Please sign in to comment.