better use if semaphore in S3 auth provider
Fix an error in chunk size calculation