Skip to content

Use progenitor-based client once scoped link-local v6 addresses are supported. #28

Open
@rcgoodfellow

Description

@rcgoodfellow

The code that we currently use for sending requests to peer routers for prefix exchange uses hyper and manual message construction.

let uri = format!(
"http://[{}%{}]:{}/pull",
addr, ctx.config.if_index, ctx.config.exchange_port,
);
let client = hyper::Client::new();
let req = hyper::Request::builder()
.method(hyper::Method::GET)
.uri(&uri)
.body(hyper::Body::empty())
.unwrap(); //TODO unwrap

let payload = serde_json::to_string(&update).unwrap(); //TODO unwrap
let uri = format!(
"http://[{}%{}]:{}/push",
addr, config.if_index, config.exchange_port,
);
let client = hyper::Client::new();
let req = hyper::Request::builder()
.method(hyper::Method::PUT)
.uri(&uri)
.body(hyper::Body::from(payload))
.unwrap(); //TODO unwrap
let resp = client.request(req);

This is because progenitor-based clients do not currently support scoped v6 addresses.

When this is addressed, we should switch to using a progenitor-based client to get more compile time safety and make things less error prone.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions