cargo fmt

This commit is contained in:
Eric Seppanen
2021-04-28 10:01:58 -07:00
parent ab61ce2267
commit 975b2d12dc
5 changed files with 38 additions and 25 deletions
+5 -5
View File
@@ -40,7 +40,7 @@ pub struct FeStartupMessage {
pub version: u32,
pub kind: StartupRequestCode,
pub timelineid: ZTimelineId,
pub appname: Option<String>,
pub appname: Option<String>,
}
#[derive(Debug)]
@@ -87,7 +87,7 @@ impl FeStartupMessage {
let params = params_str.split('\0');
let mut options = false;
let mut timelineid: Option<ZTimelineId> = None;
let mut appname: Option<String> = None;
let mut appname: Option<String> = None;
for p in params {
if p == "options" {
options = true;
@@ -97,8 +97,8 @@ impl FeStartupMessage {
// FIXME: rethrow parsing error, don't unwrap
timelineid = Some(ZTimelineId::from_str(ztimelineid_str).unwrap());
} else if let Some(val) = opt.strip_prefix("application_name=") {
appname = Some(val.to_string());
}
appname = Some(val.to_string());
}
}
break;
}
@@ -114,7 +114,7 @@ impl FeStartupMessage {
Ok(Some(FeMessage::StartupMessage(FeStartupMessage {
version,
kind,
appname,
appname,
timelineid: timelineid.unwrap(),
})))
}
+11 -11
View File
@@ -158,12 +158,12 @@ pub struct Timeline {
#[derive(Debug)]
struct Connection {
timeline: Option<Arc<Timeline>>,
stream: TcpStream, /* Postgres connection */
inbuf: BytesMut, /* input buffer */
outbuf: BytesMut, /* output buffer */
init_done: bool, /* startup packet proceeded */
appname: Option<String>,/* assigned application name */
conf: WalAcceptorConf, /* wal acceptor configuration */
stream: TcpStream, /* Postgres connection */
inbuf: BytesMut, /* input buffer */
outbuf: BytesMut, /* output buffer */
init_done: bool, /* startup packet proceeded */
appname: Option<String>, /* assigned application name */
conf: WalAcceptorConf, /* wal acceptor configuration */
}
/*
@@ -544,7 +544,7 @@ impl Connection {
inbuf: BytesMut::with_capacity(10 * 1024),
outbuf: BytesMut::with_capacity(10 * 1024),
init_done: false,
appname: None,
appname: None,
conf: conf.clone(),
}
}
@@ -857,7 +857,7 @@ impl Connection {
self.send().await?;
self.init_done = true;
self.set_timeline(m.timelineid)?;
self.appname = m.appname;
self.appname = m.appname;
}
StartupRequestCode::Cancel => return Ok(()),
}
@@ -954,9 +954,9 @@ impl Connection {
if start_pos == 0 {
start_pos = wal_end;
}
if stop_pos == 0 && self.appname == Some("wal_proposer_recovery".to_string()) {
stop_pos = wal_end;
}
if stop_pos == 0 && self.appname == Some("wal_proposer_recovery".to_string()) {
stop_pos = wal_end;
}
info!(
"Start replication from {:X}/{:>08X} till {:X}/{:>08X}",
(start_pos >> 32) as u32,