ANSC_STATUS HttpBmoDelHeaderField ( ANSC_HANDLE hThisObject, ULONG ulHeaderId ) { ANSC_STATUS returnStatus = ANSC_STATUS_SUCCESS; PHTTP_BASIC_MESSAGE_OBJECT pMyObject = (PHTTP_BASIC_MESSAGE_OBJECT)hThisObject; PHTTP_HFP_INTERFACE pHfpIf = (PHTTP_HFP_INTERFACE )pMyObject->hHfpIf; PHTTP_HEADER_FIELD pHttpHfo = NULL; ULONG ulHashIndex = AnscHashUlong(ulHeaderId, HTTP_BMO_HFO_TABLE_SIZE); ULONG ulIndex = 0; while ( TRUE ) { pHttpHfo = (PHTTP_HEADER_FIELD)pMyObject->GetHeaderField2 ( (ANSC_HANDLE)pMyObject, ulHeaderId, ulIndex ); if ( !pHttpHfo ) { if ( ulIndex == 0 ) { return ANSC_STATUS_CANT_FIND; } else { return ANSC_STATUS_SUCCESS; } } AnscAcquireLock (&pMyObject->HfoTableLock); AnscQueuePopEntryByLink(&pMyObject->HfoTable[ulHashIndex], &pHttpHfo->Linkage); AnscReleaseLock (&pMyObject->HfoTableLock); AnscFreeMemory(pHttpHfo); ulIndex ++; } return ANSC_STATUS_SUCCESS; }
char* HttpBmoGetHeaderValueById2 ( ANSC_HANDLE hThisObject, ULONG ulHeaderId, ULONG ulIndex ) { ANSC_STATUS returnStatus = ANSC_STATUS_SUCCESS; PHTTP_BASIC_MESSAGE_OBJECT pMyObject = (PHTTP_BASIC_MESSAGE_OBJECT )hThisObject; PHTTP_HFP_INTERFACE pHfpIf = (PHTTP_HFP_INTERFACE )pMyObject->hHfpIf; #ifndef _CCSP_CWMP_TCP_CONNREQ_HANDLER PHTTP_HELPER_CONTAINER_OBJECT pHttpHco = (PHTTP_HELPER_CONTAINER_OBJECT)pMyObject->hContainerContext; #endif PHTTP_HEADER_FIELD pHttpHfo = NULL; char* pHttpHfValue = NULL; pHttpHfo = (PHTTP_HEADER_FIELD)pMyObject->GetHeaderField2 ( (ANSC_HANDLE)pMyObject, ulHeaderId, ulIndex ); if ( !pHttpHfo ) { return NULL; } else if ( !(pHttpHfo->Flags & HTTP_FIELD_FLAG_LINE_PRESENT) ) { returnStatus = pHfpIf->BuildHeader ( pHfpIf->hOwnerContext, (ANSC_HANDLE)pHttpHfo, NULL, 0 ); } AnscHttpGetHfValue(pHttpHfo->HeaderLine, AnscSizeOfString(pHttpHfo->HeaderLine), pHttpHfValue); return pHttpHfValue; }