Skip to content

Commit

Permalink
Disable idle pool to maybe fix an edge case error
Browse files Browse the repository at this point in the history
```
Error: Request Error when talking to qbittorrent: error sending request for url (http://localhost:6006/api/v2/torrents/delete): connection closed before message completed

Caused by:
    0: error sending request for url (http://localhost:6006/api/v2/torrents/delete): connection closed before message completed
    1: connection closed before message completed
```
Issue: hyperium/hyper#2136
  • Loading branch information
Rudo2204 committed Jun 9, 2021
1 parent a3d7660 commit 4a44159
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions src/librpl/qbittorrent.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#![allow(dead_code)]
#![allow(unused_imports)]

use async_trait::async_trait;
use derive_builder::Builder;
use derive_getters::Getters;
Expand All @@ -9,8 +6,6 @@ use lava_torrent::torrent::v1::Torrent;
use log::{debug, error, info};
use reqwest::multipart::{Form, Part};
use serde::{Deserialize, Serialize};
use std::cmp::min;
use std::convert::TryInto;
use std::path::PathBuf;
use std::str::FromStr;
use tokio::time::{sleep, Duration};
Expand Down Expand Up @@ -165,6 +160,9 @@ impl QbitConfig {
headers.insert("Referer", address.parse()?);

let client = reqwest::Client::builder()
// Related to issue: https://github.com/hyperium/hyper/issues/2136
// https://github.com/wyyerd/stripe-rs/issues/173
.pool_max_idle_per_host(0)
.default_headers(headers)
.build()?;

Expand Down Expand Up @@ -371,10 +369,10 @@ impl QbitTorrent {
form
}

pub fn url(mut self, url: String) -> Self {
self.urls = Some(url);
self
}
//pub fn url(mut self, url: String) -> Self {
// self.urls = Some(url);
// self
//}

pub fn torrents(mut self, torrent: Torrent) -> Self {
self.torrents = Some(
Expand Down

0 comments on commit 4a44159

Please sign in to comment.