@@ -31,6 +31,15 @@ use uefi_raw::protocol::network::http::{
31
31
pub struct Http ( HttpProtocol ) ;
32
32
33
33
impl 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
+
34
43
/// Configure HTTP Protocol. Must be called before sending HTTP requests.
35
44
pub fn configure ( & mut self , config_data : & HttpConfigData ) -> uefi:: Result < ( ) > {
36
45
let status = unsafe { ( self . 0 . configure ) ( & mut self . 0 , config_data) } ;
@@ -49,6 +58,15 @@ impl Http {
49
58
}
50
59
}
51
60
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
+
52
70
/// Receive HTTP response.
53
71
pub fn response ( & mut self , token : & mut HttpToken ) -> uefi:: Result < ( ) > {
54
72
let status = unsafe { ( self . 0 . response ) ( & mut self . 0 , token) } ;
0 commit comments