Skip to content

Commit

Permalink
f remove user_agent string pass and parse
Browse files Browse the repository at this point in the history
  • Loading branch information
jrconlin committed Jan 18, 2023
1 parent 1f5eb97 commit 6b901c2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 17 deletions.
13 changes: 5 additions & 8 deletions autopush/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -312,15 +312,15 @@ where
AwaitSessionComplete {
auth_state_machine: AuthClientStateFuture<T>,
srv: Rc<Server>,
user_agent: String,
//user_agent: String,
webpush: Rc<RefCell<WebPushClient>>,
},

#[state_machine_future(transitions(UnAuthDone))]
AwaitRegistryDisconnect {
response: MyFuture<()>,
srv: Rc<Server>,
user_agent: String,
//user_agent: String,
webpush: Rc<RefCell<WebPushClient>>,
error: Option<Error>,
},
Expand Down Expand Up @@ -512,7 +512,6 @@ where
let AwaitRegistryConnect {
srv,
ws,
user_agent,
webpush,
broadcast_subs,
..
Expand All @@ -531,7 +530,6 @@ where
transition!(AwaitSessionComplete {
auth_state_machine,
srv,
user_agent,
webpush,
})
}
Expand All @@ -558,7 +556,7 @@ where

let AwaitSessionComplete {
srv,
user_agent,
//user_agent,
webpush,
..
} = session_complete.take();
Expand All @@ -570,7 +568,7 @@ where
transition!(AwaitRegistryDisconnect {
response,
srv,
user_agent,
//user_agent,
webpush,
error,
})
Expand All @@ -584,7 +582,6 @@ where

let AwaitRegistryDisconnect {
srv,
user_agent,
webpush,
error,
..
Expand All @@ -603,7 +600,7 @@ where
}
let now = ms_since_epoch();
let elapsed = (now - webpush.connected_at) / 1_000;
let ua_info = UserAgentInfo::from(user_agent.as_ref());
let ua_info = webpush.ua_info.clone();
// dogstatsd doesn't support timers: use histogram instead
srv.metrics
.time_with_tags("ua.connection.lifespan", elapsed)
Expand Down
9 changes: 0 additions & 9 deletions autopush/src/user_agent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,6 @@ impl From<&str> for UserAgentInfo {
}
}

/*
impl UserAgentInfo {
pub fn parsed(&self) -> WootheeResult {
let parser = Parser::new();
parser.parse(&self._user_agent_string).unwrap_or_default()
}
}
*/

#[cfg(test)]
mod tests {
use super::UserAgentInfo;
Expand Down

0 comments on commit 6b901c2

Please sign in to comment.