diff --git a/lib/api/source/sync.php b/lib/api/source/sync.php index 2b8b045..472954b 100755 --- a/lib/api/source/sync.php +++ b/lib/api/source/sync.php @@ -113,10 +113,13 @@ curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($curl); - /* (2) Close request */ + /* (2) Save response to file */ + file_put_contents(TMP_DIR.'/api.response', $response); + + /* (3) Close request */ curl_close($curl); - /* (3) Return response as result */ + /* (4) Return response as result */ if( $response === false ){ slog("Request error", 'api:sync','update'); return 127; @@ -141,10 +144,6 @@ } - /* (3) Writes request to temporary pipe */ - file_put_contents(TMP_DIR.'/api.response', $response); - - /* [7] Decrement cyclic-hash so request has ran successfully =========================================================*/ /* (1) Decrement the hash */ diff --git a/lib/api/source/update.php b/lib/api/source/update.php index ab92e5c..1e159b6 100755 --- a/lib/api/source/update.php +++ b/lib/api/source/update.php @@ -97,10 +97,13 @@ curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($curl); - /* (2) Close request */ + /* (2) Save response to file */ + file_put_contents(TMP_DIR.'/api.response', $response); + + /* (3) Close request */ curl_close($curl); - /* (3) Return response as result */ + /* (4) Return response as result */ if( $response === false ){ slog("Request error", 'api:update','update'); return 127; @@ -123,9 +126,6 @@ return 127; } - /* (3) Writes request to temporary pipe */ - file_put_contents(TMP_DIR.'/api.response', $response); - /* [7] Decrement cyclic-hash so request has ran successfully =========================================================*/