summaryrefslogtreecommitdiffstats
path: root/NetworkPkg/HttpBootDxe/HttpBootSupport.c
diff options
context:
space:
mode:
Diffstat (limited to 'NetworkPkg/HttpBootDxe/HttpBootSupport.c')
-rw-r--r--NetworkPkg/HttpBootDxe/HttpBootSupport.c130
1 files changed, 0 insertions, 130 deletions
diff --git a/NetworkPkg/HttpBootDxe/HttpBootSupport.c b/NetworkPkg/HttpBootDxe/HttpBootSupport.c
index 93d9dfc464..37a95e031e 100644
--- a/NetworkPkg/HttpBootDxe/HttpBootSupport.c
+++ b/NetworkPkg/HttpBootDxe/HttpBootSupport.c
@@ -491,136 +491,6 @@ Exit:
return Status;
}
-/**
- Create a HTTP_IO_HEADER to hold the HTTP header items.
-
- @param[in] MaxHeaderCount The maximum number of HTTP header in this holder.
-
- @return A pointer of the HTTP header holder or NULL if failed.
-
-**/
-HTTP_IO_HEADER *
-HttpBootCreateHeader (
- UINTN MaxHeaderCount
- )
-{
- HTTP_IO_HEADER *HttpIoHeader;
-
- if (MaxHeaderCount == 0) {
- return NULL;
- }
-
- HttpIoHeader = AllocateZeroPool (sizeof (HTTP_IO_HEADER) + MaxHeaderCount * sizeof (EFI_HTTP_HEADER));
- if (HttpIoHeader == NULL) {
- return NULL;
- }
-
- HttpIoHeader->MaxHeaderCount = MaxHeaderCount;
- HttpIoHeader->Headers = (EFI_HTTP_HEADER *) (HttpIoHeader + 1);
-
- return HttpIoHeader;
-}
-
-/**
- Destroy the HTTP_IO_HEADER and release the resources.
-
- @param[in] HttpIoHeader Point to the HTTP header holder to be destroyed.
-
-**/
-VOID
-HttpBootFreeHeader (
- IN HTTP_IO_HEADER *HttpIoHeader
- )
-{
- UINTN Index;
-
- if (HttpIoHeader != NULL) {
- if (HttpIoHeader->HeaderCount != 0) {
- for (Index = 0; Index < HttpIoHeader->HeaderCount; Index++) {
- FreePool (HttpIoHeader->Headers[Index].FieldName);
- FreePool (HttpIoHeader->Headers[Index].FieldValue);
- }
- }
- FreePool (HttpIoHeader);
- }
-}
-
-/**
- Set or update a HTTP header with the field name and corresponding value.
-
- @param[in] HttpIoHeader Point to the HTTP header holder.
- @param[in] FieldName Null terminated string which describes a field name.
- @param[in] FieldValue Null terminated string which describes the corresponding field value.
-
- @retval EFI_SUCCESS The HTTP header has been set or updated.
- @retval EFI_INVALID_PARAMETER Any input parameter is invalid.
- @retval EFI_OUT_OF_RESOURCES Insufficient resource to complete the operation.
- @retval Other Unexpected error happened.
-
-**/
-EFI_STATUS
-HttpBootSetHeader (
- IN HTTP_IO_HEADER *HttpIoHeader,
- IN CHAR8 *FieldName,
- IN CHAR8 *FieldValue
- )
-{
- EFI_HTTP_HEADER *Header;
- UINTN StrSize;
- CHAR8 *NewFieldValue;
-
- if (HttpIoHeader == NULL || FieldName == NULL || FieldValue == NULL) {
- return EFI_INVALID_PARAMETER;
- }
-
- Header = HttpFindHeader (HttpIoHeader->HeaderCount, HttpIoHeader->Headers, FieldName);
- if (Header == NULL) {
- //
- // Add a new header.
- //
- if (HttpIoHeader->HeaderCount >= HttpIoHeader->MaxHeaderCount) {
- return EFI_OUT_OF_RESOURCES;
- }
- Header = &HttpIoHeader->Headers[HttpIoHeader->HeaderCount];
-
- StrSize = AsciiStrSize (FieldName);
- Header->FieldName = AllocatePool (StrSize);
- if (Header->FieldName == NULL) {
- return EFI_OUT_OF_RESOURCES;
- }
- CopyMem (Header->FieldName, FieldName, StrSize);
- Header->FieldName[StrSize -1] = '\0';
-
- StrSize = AsciiStrSize (FieldValue);
- Header->FieldValue = AllocatePool (StrSize);
- if (Header->FieldValue == NULL) {
- FreePool (Header->FieldName);
- return EFI_OUT_OF_RESOURCES;
- }
- CopyMem (Header->FieldValue, FieldValue, StrSize);
- Header->FieldValue[StrSize -1] = '\0';
-
- HttpIoHeader->HeaderCount++;
- } else {
- //
- // Update an existing one.
- //
- StrSize = AsciiStrSize (FieldValue);
- NewFieldValue = AllocatePool (StrSize);
- if (NewFieldValue == NULL) {
- return EFI_OUT_OF_RESOURCES;
- }
- CopyMem (NewFieldValue, FieldValue, StrSize);
- NewFieldValue[StrSize -1] = '\0';
-
- if (Header->FieldValue != NULL) {
- FreePool (Header->FieldValue);
- }
- Header->FieldValue = NewFieldValue;
- }
-
- return EFI_SUCCESS;
-}
/**
This function checks the HTTP(S) URI scheme.