@@ -788,6 +788,8 @@ static int ca_chunk_downloader_step(CaChunkDownloader *dl) {
788788 r = ca_chunk_downloader_process_curl_multi (dl );
789789 if (r < 0 )
790790 return log_error_errno (r , "Failed while processing curl multi: %m" );
791+ if (r > 0 )
792+ log_trace ("Processed %d curl messages" , r );
791793
792794 /* Step around */
793795 r = ca_chunk_downloader_remote_step (dl );
@@ -804,13 +806,17 @@ static int ca_chunk_downloader_step(CaChunkDownloader *dl) {
804806 return r ;
805807 if (r < 0 )
806808 return log_error_errno (r , "Failed while putting chunks to remote: %m" );
809+ if (r > 0 )
810+ log_trace ("Put %d chunks to remote" , r );
807811
808812 /* Get as many chunk requests as we can */
809813 r = ca_chunk_downloader_fetch_chunk_requests (dl );
810814 if (r == - EPIPE )
811815 return r ;
812816 if (r < 0 )
813817 return log_error_errno (r , "Failed while querying remote for chunk requests: %m" );
818+ if (r > 0 )
819+ log_trace ("Fetched %d chunk requests from remote" , r );
814820
815821 return CA_CHUNK_DOWNLOADER_POLL ;
816822}
@@ -861,10 +867,15 @@ static int ca_chunk_downloader_wait(CaChunkDownloader *dl) {
861867 if (r < 0 )
862868 return log_error_errno (r , "Failed to get remote io: %m" );
863869
870+ log_trace ("SLEEP - handles: added=%" PRIu64 ", rem=%" PRIu64 " - chunks: put=%" PRIu64 ,
871+ dl -> inprogress -> n_added , dl -> inprogress -> n_removed , dl -> completed -> n_removed );
872+
864873 c = curl_multi_wait (dl -> multi , waitfds , ELEMENTSOF (waitfds ), curl_timeout_ms , & n );
865874 if (c != CURLM_OK )
866875 return log_error_curlm (c , "Failed to wait with curl multi" );
867876
877+ log_trace ("AWAKEN - %d event(s)" , n );
878+
868879 return 0 ;
869880}
870881
0 commit comments