From c06a9aaf739311caa5596c0a01c18108b3f4b43b Mon Sep 17 00:00:00 2001
From: Enris Nogare von Tein <ent13@inf.ufpr.br>
Date: Tue, 7 Jun 2016 10:09:46 -0300
Subject: [PATCH] Upload now prints any response got for debugging. Will be
 removed ion final version. Decreased timeout on failed uploads from 50 to 5

Signed-off-by: Enris Nogare von Tein <ent13@inf.ufpr.br>
---
 scripts/clone_stage4    | 2 +-
 useful/stg312/.size.out | 2 +-
 useful/stg312/.upid.out | 1 +
 useful/stg312/upload.c  | 3 ++-
 4 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/scripts/clone_stage4 b/scripts/clone_stage4
index 4c430aa8..26e4e08d 100755
--- a/scripts/clone_stage4
+++ b/scripts/clone_stage4
@@ -54,5 +54,5 @@ else
 fi
 
 pinfo "Cloning via rsync"
-cat "$INCLUDE" "$EXCLUDE" | rsync -a --delete --delete-excluded --numeric-ids -v --exclude-from=- "${RSYNC_OPTS}" "${RSYNC_SOURCE}" "${TARGET_DIR}" || perror "rsync from '${RSYNC_SOURCE}' to '${TARGET_DIR}' failed."
+cat "$INCLUDE" "$EXCLUDE" | rsync -a --delete --exclude="${TARGET_DIR}" --delete-excluded --numeric-ids -v --exclude-from=- "${RSYNC_OPTS}" "${RSYNC_SOURCE}" "${TARGET_DIR}" || perror "rsync from '${RSYNC_SOURCE}' to '${TARGET_DIR}' failed."
 
diff --git a/useful/stg312/.size.out b/useful/stg312/.size.out
index 3d40297f..ef0af295 100644
--- a/useful/stg312/.size.out
+++ b/useful/stg312/.size.out
@@ -1 +1 @@
-1731216	teste.r1.tar.gz
+1726520	trying.r1.tar.gz
diff --git a/useful/stg312/.upid.out b/useful/stg312/.upid.out
index e69de29b..980a992b 100644
--- a/useful/stg312/.upid.out
+++ b/useful/stg312/.upid.out
@@ -0,0 +1 @@
+{"uploadid":"XoqQjZRveULpcdtxUzzB431MnUxQZ1UwheD","status":"ok","code":"003","msg":"New upload succesful"}
\ No newline at end of file
diff --git a/useful/stg312/upload.c b/useful/stg312/upload.c
index 410e9f46..de58e0c8 100644
--- a/useful/stg312/upload.c
+++ b/useful/stg312/upload.c
@@ -22,6 +22,7 @@ int checa_sucesso_upload(){
     char *user_data_str;
     user_data_str = malloc(2550*sizeof(char));
     user_data = fopen(".upload.out", "r");
+    system("cat .upload.out");
     fgets(user_data_str,2550*sizeof(char), user_data );
     puts("User data: ");
     puts(user_data_str);
@@ -323,7 +324,7 @@ int main(int argc, char *argv[]){
                     puts("Sistema irá tentar reenviar a ultima parte.");
                     --i;
                     timeout_count++;
-                    if(timeout_count == 50){
+                    if(timeout_count == 5){
                         puts("Conexão com o banco perdida. Tente novamente.");
                         return 0;
                     }
-- 
GitLab