move src/server/h2service.rs into proxmox-rest-server crate
This commit is contained in:
parent
e8c124fe1b
commit
85ec987a48
@ -11,8 +11,8 @@ use hyper::{Body, Request, Response, StatusCode};
|
||||
use proxmox::api::{ApiResponseFuture, HttpError, Router, RpcEnvironment};
|
||||
use proxmox::http_err;
|
||||
|
||||
use proxmox_rest_server::{normalize_uri_path, WorkerTask};
|
||||
use proxmox_rest_server::formatter::*;
|
||||
use crate::{normalize_uri_path, WorkerTask};
|
||||
use crate::formatter::*;
|
||||
|
||||
/// Hyper Service implementation to handle stateful H2 connections.
|
||||
///
|
||||
@ -59,7 +59,7 @@ impl <E: RpcEnvironment + Clone> H2Service<E> {
|
||||
future::ok((formatter.format_error)(err)).boxed()
|
||||
}
|
||||
Some(api_method) => {
|
||||
proxmox_rest_server::handle_api_request(
|
||||
crate::rest::handle_api_request(
|
||||
self.rpcenv.clone(), api_method, formatter, parts, body, uri_param).boxed()
|
||||
}
|
||||
}
|
@ -30,11 +30,14 @@ mod api_config;
|
||||
pub use api_config::ApiConfig;
|
||||
|
||||
mod rest;
|
||||
pub use rest::{RestServer, handle_api_request};
|
||||
pub use rest::RestServer;
|
||||
|
||||
mod worker_task;
|
||||
pub use worker_task::*;
|
||||
|
||||
mod h2service;
|
||||
pub use h2service::*;
|
||||
|
||||
pub enum AuthError {
|
||||
Generic(Error),
|
||||
NoData,
|
||||
|
@ -388,7 +388,7 @@ async fn proxy_protected_request(
|
||||
Ok(resp)
|
||||
}
|
||||
|
||||
pub async fn handle_api_request<Env: RpcEnvironment, S: 'static + BuildHasher + Send>(
|
||||
pub(crate) async fn handle_api_request<Env: RpcEnvironment, S: 'static + BuildHasher + Send>(
|
||||
mut rpcenv: Env,
|
||||
info: &'static ApiMethod,
|
||||
formatter: &'static OutputFormatter,
|
||||
|
Loading…
x
Reference in New Issue
Block a user