@@ -31,6 +31,15 @@ use uefi_raw::protocol::network::http::{
3131pub struct Http ( HttpProtocol ) ;
3232
3333impl Http {
34+ /// Receive HTTP Protocol configuration.
35+ pub fn get_mode_data ( & mut self , config_data : & mut HttpConfigData ) -> uefi:: Result < ( ) > {
36+ let status = unsafe { ( self . 0 . get_mode_data ) ( & mut self . 0 , config_data) } ;
37+ match status {
38+ Status :: SUCCESS => Ok ( ( ) ) ,
39+ _ => Err ( status. into ( ) ) ,
40+ }
41+ }
42+
3443 /// Configure HTTP Protocol. Must be called before sending HTTP requests.
3544 pub fn configure ( & mut self , config_data : & HttpConfigData ) -> uefi:: Result < ( ) > {
3645 let status = unsafe { ( self . 0 . configure ) ( & mut self . 0 , config_data) } ;
@@ -49,6 +58,15 @@ impl Http {
4958 }
5059 }
5160
61+ /// Cancel HTTP request.
62+ pub fn cancel ( & mut self , token : & mut HttpToken ) -> uefi:: Result < ( ) > {
63+ let status = unsafe { ( self . 0 . cancel ) ( & mut self . 0 , token) } ;
64+ match status {
65+ Status :: SUCCESS => Ok ( ( ) ) ,
66+ _ => Err ( status. into ( ) ) ,
67+ }
68+ }
69+
5270 /// Receive HTTP response.
5371 pub fn response ( & mut self , token : & mut HttpToken ) -> uefi:: Result < ( ) > {
5472 let status = unsafe { ( self . 0 . response ) ( & mut self . 0 , token) } ;
0 commit comments