Skip to content

Commit

Permalink
send close request when HTTP is executed only once
Browse files Browse the repository at this point in the history
  • Loading branch information
Horusiath committed Nov 20, 2023
1 parent 9e0421b commit 2ae48cb
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/http.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,16 @@ impl Client {
} else {
Cookie::default()
};
let mut requests = vec![pipeline::StreamRequest::Execute(
pipeline::StreamExecuteReq { stmt },
)];
if tx_id == 0 {
// automatically close one-shot requests
requests.push(pipeline::StreamRequest::Close);
}
let msg = pipeline::ClientMsg {
baton: cookie.baton,
requests: vec![pipeline::StreamRequest::Execute(
pipeline::StreamExecuteReq { stmt },
)],
requests,
};
let body = serde_json::to_string(&msg)?;
let url = cookie
Expand Down

0 comments on commit 2ae48cb

Please sign in to comment.