]> git.proxmox.com Git - mirror_edk2.git/blob - AppPkg/Applications/Sockets/WebServer/Exit.c
1b7c82de9abc12dc2544630c01aa3f7d8f00aa5b
[mirror_edk2.git] / AppPkg / Applications / Sockets / WebServer / Exit.c
1 /**
2 @file
3 Exit response page
4
5 Copyright (c) 2011-2012, Intel Corporation. All rights reserved.
6 SPDX-License-Identifier: BSD-2-Clause-Patent
7
8 **/
9
10 #include <WebServer.h>
11
12
13 /**
14 Respond with the Exit page
15
16 @param [in] SocketFD The socket's file descriptor to add to the list.
17 @param [in] pPort The WSDT_PORT structure address
18 @param [out] pbDone Address to receive the request completion status
19
20 @retval EFI_SUCCESS The request was successfully processed
21
22 **/
23 EFI_STATUS
24 ExitPage (
25 IN int SocketFD,
26 IN WSDT_PORT * pPort,
27 OUT BOOLEAN * pbDone
28 )
29 {
30 EFI_STATUS Status;
31
32 DBG_ENTER ( );
33
34 //
35 // Send the Hello World page
36 //
37 for ( ; ; ) {
38 //
39 // Tell the web-server to exit
40 //
41 mWebServer.bRunning = FALSE;
42
43 //
44 // Send the page header
45 //
46 Status = HttpPageHeader ( SocketFD, pPort, L"Exit" );
47 if ( EFI_ERROR ( Status )) {
48 break;
49 }
50
51 //
52 // Send the page body
53 //
54 Status = HttpSendAnsiString ( SocketFD,
55 pPort,
56 "<h1>Exit</h1>\r\n"
57 "<p>\r\n"
58 " Exiting the web-server application.\r\n"
59 "</p>\r\n" );
60 if ( EFI_ERROR ( Status )) {
61 break;
62 }
63
64 //
65 // Send the page trailer
66 //
67 Status = HttpPageTrailer ( SocketFD, pPort, pbDone );
68 break;
69 }
70
71 //
72 // Return the operation status
73 //
74 DBG_EXIT_STATUS ( Status );
75 return Status;
76 }