diff --git a/src/filter/http_context.rs b/src/filter/http_context.rs index 27d3c85..ec3d4af 100644 --- a/src/filter/http_context.rs +++ b/src/filter/http_context.rs @@ -133,13 +133,17 @@ impl Context for Filter { if GrpcService::process_grpc_response(operation, resp_size).is_ok() { // call the next op match self.operation_dispatcher.borrow_mut().next() { - Ok(_) => {} // no action needed + Ok(some_op) => { + if some_op.is_none() { + // No more operations left in queue, resuming + self.resume_http_request(); + } + } Err(op_err) => { // If desired, we could check the error status. GrpcService::handle_error_on_grpc_response(op_err.failure_mode); } } - self.resume_http_request(); } } Err(e) => { diff --git a/src/service.rs b/src/service.rs index e84d9a7..575281a 100644 --- a/src/service.rs +++ b/src/service.rs @@ -85,7 +85,7 @@ impl GrpcService { match failure_mode { FailureMode::Deny => { hostcalls::send_http_response(500, vec![], Some(b"Internal Server Error.\n")) - .unwrap() + .unwrap(); } FailureMode::Allow => hostcalls::resume_http_request().unwrap(), }