Skip to content

Allow passing in an optional plugin_arg - #297

Merged
zonyitoo merged 2 commits into
shadowsocks:masterfrom
Mygod:plugin-arg
Oct 6, 2020
Merged

Allow passing in an optional plugin_arg#297
zonyitoo merged 2 commits into
shadowsocks:masterfrom
Mygod:plugin-arg

Conversation

@Mygod

@Mygod Mygod commented Oct 4, 2020

Copy link
Copy Markdown
Contributor

To be used by shadowsocks/shadowsocks-android#2585.

@madeye Please review?

@madeye madeye left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Mygod
Mygod requested a review from madeye October 4, 2020 21:34
@Mygod

Mygod commented Oct 4, 2020

Copy link
Copy Markdown
Contributor Author

Oops misclicked request review. Ignore that. 🤣

@zonyitoo

zonyitoo commented Oct 6, 2020

Copy link
Copy Markdown
Collaborator

Shouldn't it be an array of strings? @Mygod

"plugin_args": ["-a", "xxx"]

Otherwise, we can only pass one argument to plugins. It should be more flexible.

I could modify it for you if you will.

@Mygod

Mygod commented Oct 6, 2020

Copy link
Copy Markdown
Contributor Author

It's for internal use only and we only need one but sure feel free to change it.

@zonyitoo

zonyitoo commented Oct 6, 2020

Copy link
Copy Markdown
Collaborator

It works perfectly. I am going to merge it now.

@zonyitoo
zonyitoo merged commit a3dfda6 into shadowsocks:master Oct 6, 2020
@madeye

madeye commented Oct 20, 2020

Copy link
Copy Markdown
Contributor

A quick question, I got this kind of errors when building the master branch. Anything I missed here?

error[E0277]: the trait bound `std::net::SocketAddr: std::cmp::Ord` is not satisfied
   --> src/relay/udprelay/association.rs:795:62
    |
795 |         let resolved_address_cache = Arc::new(SyncMutex::new(LruCache::with_expiry_duration_and_capacity(
    |                                                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::cmp::Ord` is not implemented for `std::net::SocketAddr`
    |
    = note: required by `lru_time_cache::LruCache::<Key, Value>::with_expiry_duration_and_capacity`

error[E0599]: no method named `insert` found for struct `spin::mutex::MutexGuard<'_, lru_time_cache::LruCache<std::net::SocketAddr, relay::socks5::Address>>` in the current scope
   --> src/relay/udprelay/association.rs:925:47
    |
925 |                   resolved_address_cache.lock().insert(remote_addr, addr.clone());
    |                                                 ^^^^^^ method not found in `spin::mutex::MutexGuard<'_, lru_time_cache::LruCache<std::net::SocketAddr, relay::socks5::Address>>`
    |
    = note: the method `insert` exists but the following trait bounds were not satisfied:
            `std::net::SocketAddr: std::cmp::Ord`

error[E0599]: no method named `get` found for struct `spin::mutex::MutexGuard<'_, lru_time_cache::LruCache<std::net::SocketAddr, relay::socks5::Address>>` in the current scope
   --> src/relay/udprelay/association.rs:972:56
    |
972 |           let addr = match resolved_address_cache.lock().get(&remote_addr) {
    |                                                          ^^^ method not found in `spin::mutex::MutexGuard<'_, lru_time_cache::LruCache<std::net::SocketAddr, relay::socks5::Address>>`
    |
    = note: the method `get` exists but the following trait bounds were not satisfied:
            `std::net::SocketAddr: std::cmp::Ord`

@zonyitoo

zonyitoo commented Oct 20, 2020

Copy link
Copy Markdown
Collaborator
error[E0277]: the trait bound `std::net::SocketAddr: std::cmp::Ord` is not satisfied.

Upgrade your Rust :P rust-lang/rust#72239

@madeye

madeye commented Oct 20, 2020

Copy link
Copy Markdown
Contributor

😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants