From 59bc059327dd519619fa437c0d7c941e090cd8a3 Mon Sep 17 00:00:00 2001 From: lpleahy Date: Fri, 30 Sep 2011 23:04:13 +0000 Subject: Update the sockets applications * Builds with GCC 4.4 compiler. Signed-off by: lpleahy git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12498 6f19259b-4bc3-4df7-8a09-765794883524 --- AppPkg/Applications/Sockets/WebServer/WebServer.c | 38 +++++++++++------------ 1 file changed, 18 insertions(+), 20 deletions(-) (limited to 'AppPkg/Applications/Sockets/WebServer/WebServer.c') diff --git a/AppPkg/Applications/Sockets/WebServer/WebServer.c b/AppPkg/Applications/Sockets/WebServer/WebServer.c index 00bf4b6fef..5c73bfe8f7 100644 --- a/AppPkg/Applications/Sockets/WebServer/WebServer.c +++ b/AppPkg/Applications/Sockets/WebServer/WebServer.c @@ -124,9 +124,9 @@ PortAdd ( // Initialize the new entries in the FD list // for ( ; MaxEntriesNew > Index; Index++ ) { - pFdListNew [ Index ].fd = -1; - pFdListNew [ Index ].events = 0; - pFdListNew [ Index ].revents = 0; + pFdListNew[ Index ].fd = -1; + pFdListNew[ Index ].events = 0; + pFdListNew[ Index ].revents = 0; } // @@ -156,7 +156,7 @@ PortAdd ( // Initialize the new entries in the port list // for ( ; MaxEntriesNew > Index; Index++ ) { - ppPortListNew [ Index ] = NULL; + ppPortListNew[ Index ] = NULL; } // @@ -200,15 +200,15 @@ PortAdd ( // // Add the socket to the FD list // - pFdList [ pWebServer->Entries ].fd = SocketFD; - pFdList [ pWebServer->Entries ].events = POLLRDNORM + pFdList[ pWebServer->Entries ].fd = SocketFD; + pFdList[ pWebServer->Entries ].events = POLLRDNORM | POLLHUP; - pFdList [ pWebServer->Entries ].revents = 0; + pFdList[ pWebServer->Entries ].revents = 0; // // Add the port to the port list // - pWebServer->ppPortList [ pWebServer->Entries ] = pPort; + pWebServer->ppPortList[ pWebServer->Entries ] = pPort; // // Account for the new entry @@ -263,7 +263,7 @@ PortRemove ( // // Locate the specified socket file descriptor // - if ( SocketFD == pFdList [ Index ].fd ) { + if ( SocketFD == pFdList[ Index ].fd ) { // // Determine if this is the listen port // @@ -279,7 +279,7 @@ PortRemove ( // // Free the port structure // - gBS->FreePool ( ppPortList [ Index ]); + gBS->FreePool ( ppPortList[ Index ]); // // Remove this port from the list by copying @@ -287,13 +287,13 @@ PortRemove ( // Entries -= 1; for ( ; Entries > Index; Index++ ) { - pFdList [ Index ] = pFdList [ Index + 1 ]; - ppPortList [ Index ] = ppPortList [ Index + 1 ]; + pFdList[ Index ] = pFdList[ Index + 1 ]; + ppPortList[ Index ] = ppPortList[ Index + 1 ]; } - pFdList [ Index ].fd = -1; - pFdList [ Index ].events = 0; - pFdList [ Index ].revents = 0; - ppPortList [ Index ] = NULL; + pFdList[ Index ].fd = -1; + pFdList[ Index ].events = 0; + pFdList[ Index ].revents = 0; + ppPortList[ Index ] = NULL; // // Update the number of entries in the list @@ -439,8 +439,7 @@ PortWork ( } } } - else - { + else { // // Receive the file data // @@ -610,8 +609,7 @@ WebServerTimer ( pWebServer->HttpListenPort = socket ( AF_INET, SOCK_STREAM, IPPROTO_TCP ); - if ( -1 != pWebServer->HttpListenPort ) - { + if ( -1 != pWebServer->HttpListenPort ) { // // Set the socket address // -- cgit v1.2.3