Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow passing in an optional plugin_arg #297

Merged
merged 2 commits into from
Oct 6, 2020

Conversation

Mygod
Copy link
Contributor

@Mygod Mygod commented Oct 4, 2020

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

@madeye Please review?

Copy link
Contributor

@madeye madeye left a comment

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
Copy link
Contributor Author

Mygod commented Oct 4, 2020

Oops misclicked request review. Ignore that. 🤣

@zonyitoo
Copy link
Collaborator

zonyitoo commented Oct 6, 2020

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
Copy link
Contributor Author

Mygod commented Oct 6, 2020

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

@zonyitoo
Copy link
Collaborator

zonyitoo commented Oct 6, 2020

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

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

madeye commented Oct 20, 2020

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
Copy link
Collaborator

zonyitoo commented Oct 20, 2020

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

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

@madeye
Copy link
Contributor

madeye commented Oct 20, 2020

😅

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.

None yet

3 participants