Unverified Commit 7d894e55 authored by Ge Jun's avatar Ge Jun Committed by GitHub

Merge pull request #773 from zyearn/fix_backup_using_h2

Fix backup req using h2
parents 8fe8640e 7384bf7b
...@@ -690,7 +690,7 @@ inline bool does_error_affect_main_socket(int error_code) { ...@@ -690,7 +690,7 @@ inline bool does_error_affect_main_socket(int error_code) {
error_code == EINVAL/*returned by connect "0.0.0.1"*/; error_code == EINVAL/*returned by connect "0.0.0.1"*/;
} }
//Note: A RPC call is probably consisted by serveral individual Calls such as //Note: A RPC call is probably consisted by several individual Calls such as
// retries and backup requests. This method simply cares about the error of // retries and backup requests. This method simply cares about the error of
// this very Call (specified by |error_code|) rather than the error of the // this very Call (specified by |error_code|) rather than the error of the
// entire RPC (specified by c->FailedInline()). // entire RPC (specified by c->FailedInline()).
......
...@@ -1449,10 +1449,10 @@ private: ...@@ -1449,10 +1449,10 @@ private:
void H2UnsentRequest::DestroyStreamUserData(SocketUniquePtr& sending_sock, void H2UnsentRequest::DestroyStreamUserData(SocketUniquePtr& sending_sock,
Controller* cntl, Controller* cntl,
int /*error_code*/, int error_code,
bool /*end_of_rpc*/) { bool /*end_of_rpc*/) {
RemoveRefOnQuit deref_self(this); RemoveRefOnQuit deref_self(this);
if (sending_sock != NULL && cntl->ErrorCode() != 0) { if (sending_sock != NULL && error_code != 0) {
CHECK_EQ(cntl, _cntl); CHECK_EQ(cntl, _cntl);
std::unique_lock<butil::Mutex> mu(_mutex); std::unique_lock<butil::Mutex> mu(_mutex);
_cntl = NULL; _cntl = NULL;
......
...@@ -66,8 +66,8 @@ public: ...@@ -66,8 +66,8 @@ public:
// Params: // Params:
// sending_sock: The socket chosen by OnCreatingStream(), if an error // sending_sock: The socket chosen by OnCreatingStream(), if an error
// happens during choosing, the enclosed socket is NULL. // happens during choosing, the enclosed socket is NULL.
// cntl: contexts of the RPC // cntl: contexts of the RPC.
// error_code: Use this instead of cntl->ErrorCode() // error_code: Use this instead of cntl->ErrorCode().
// end_of_rpc: true if the RPC is about to destroyed. // end_of_rpc: true if the RPC is about to destroyed.
virtual void DestroyStreamUserData(SocketUniquePtr& sending_sock, virtual void DestroyStreamUserData(SocketUniquePtr& sending_sock,
Controller* cntl, Controller* cntl,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment