Skip to content

Commit

Permalink
Merge pull request #67 from ddbnl/interactive
Browse files Browse the repository at this point in the history
Interactive
  • Loading branch information
ddbnl authored Mar 25, 2024
2 parents 04fa082 + 7979b05 commit be77904
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 12 deletions.
4 changes: 2 additions & 2 deletions Release/Linux/OfficeAuditLogCollector
Git LFS file not shown
4 changes: 2 additions & 2 deletions Release/Windows/OfficeAuditLogCollector.exe
Git LFS file not shown
33 changes: 25 additions & 8 deletions src/api_connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -259,16 +259,33 @@ async fn handle_blob_response(
mut blob_error_tx: Sender<(String, String)>, content_type: String, url: String,
known_blobs: &HashMap<String, String>, duplicate: usize) {

handle_blob_response_paging(&resp, blobs_tx, status_tx.clone(),
content_type.clone()).await;
match resp.json::<Vec<HashMap<String, Value>>>().await {
Ok(i) => {
handle_blob_response_content_uris(status_tx, content_tx, content_type, i, known_blobs,
duplicate)
.await;
handle_blob_response_paging(&resp, blobs_tx, status_tx.clone(), content_type.clone()).await;

match resp.text().await {
Ok(text) => {
match serde_json::from_str::<Vec<HashMap<String, Value>>>(text.as_str()) {
Ok(i) => {
handle_blob_response_content_uris(status_tx, content_tx, content_type, i, known_blobs,
duplicate)
.await;
},
Err(e) => {
warn!("Error getting blob JSON {}", e);
debug!("Errored blob json content: {}", text);
match blob_error_tx.send((content_type, url)).await {
Err(e) => {
error!("Could not resend failed blob, dropping it: {}", e);
status_tx.send(StatusMessage::ErrorContentBlob).await.unwrap_or_else(
|e| panic!("Could not send status update, channel closed?: {}", e)
);
},
_=> (),
}
}
}
},
Err(e) => {
warn!("Error getting blob JSON {}", e);
warn!("Error getting blob response text {}", e);
match blob_error_tx.send((content_type, url)).await {
Err(e) => {
error!("Could not resend failed blob, dropping it: {}", e);
Expand Down

0 comments on commit be77904

Please sign in to comment.