Switch ldk-server-client from reqwest to bitreq#127
Switch ldk-server-client from reqwest to bitreq#127Anyitechs wants to merge 1 commit intolightningdevkit:mainfrom
ldk-server-client from reqwest to bitreq#127Conversation
|
👋 Thanks for assigning @benthecarman as a reviewer! |
|
🔔 1st Reminder Hey @benthecarman! This PR has been waiting for your review. |
benthecarman
left a comment
There was a problem hiding this comment.
We might want to hold off until ldk and ldk node have switched over for a clean break
| LdkServerError::new(InternalError, format!("Failed to read response body: {}", e)) | ||
| })?; | ||
| let status_code = response.status_code; | ||
| let is_success_status_code = || -> bool { (200..300).contains(&status_code) }; |
There was a problem hiding this comment.
Why is this a function?
There was a problem hiding this comment.
Was trying to mirror the is_success() function from reqwest and maintain a simple check like we were doing before decoding the response.
| }; | ||
|
|
||
| const APPLICATION_OCTET_STREAM: &str = "application/octet-stream"; | ||
| const MAX_CACHED_CONNECTIONS: usize = 10; |
There was a problem hiding this comment.
Is this what they're doing in corepc? I feel like this could be a lot lower. Not a huge deal though
There was a problem hiding this comment.
Is this what they're doing in corepc?
Not sure, but the least recently used connection gets evicted when the cache is full. We can increase it (but not sure what the default is, so it will guide that as the docs didn't mention it)
This will switch
ldk-server-clientfrom using thereqwestdep to using the ecosystem maintained bitreq crate.Meanwhile, this will be in draft till rust-bitcoin/corepc#502 hopefully lands and released, so we can bring back ability to load custom root certificates.
Closes #119