Lines Matching refs:pReq
179 void Flush_RespBuf_r( LSAPI_Request * pReq );
427 static void lsapi_close_connection(LSAPI_Request *pReq) in lsapi_close_connection() argument
429 if (pReq->m_fd == -1) in lsapi_close_connection()
431 lsapi_close(pReq->m_fd); in lsapi_close_connection()
432 pReq->m_fd = -1; in lsapi_close_connection()
541 static inline int allocateBuf( LSAPI_Request * pReq, int size ) in allocateBuf() argument
543 char * pBuf = (char *)realloc( pReq->m_pReqBuf, size ); in allocateBuf()
546 pReq->m_pReqBuf = pBuf; in allocateBuf()
547 pReq->m_reqBufSize = size; in allocateBuf()
548 pReq->m_pHeader = (struct lsapi_req_header *)pReq->m_pReqBuf; in allocateBuf()
555 static int allocateIovec( LSAPI_Request * pReq, int n ) in allocateIovec() argument
558 pReq->m_pIovec, sizeof(struct iovec) * n ); in allocateIovec()
561 pReq->m_pIovecToWrite = p + ( pReq->m_pIovecToWrite - pReq->m_pIovec ); in allocateIovec()
562 pReq->m_pIovecCur = p + ( pReq->m_pIovecCur - pReq->m_pIovec ); in allocateIovec()
563 pReq->m_pIovec = p; in allocateIovec()
564 pReq->m_pIovecEnd = p + n; in allocateIovec()
569 static int allocateRespHeaderBuf( LSAPI_Request * pReq, int size ) in allocateRespHeaderBuf() argument
571 char * p = (char *)realloc( pReq->m_pRespHeaderBuf, size ); in allocateRespHeaderBuf()
574 pReq->m_pRespHeaderBufPos = p + ( pReq->m_pRespHeaderBufPos - pReq->m_pRespHeaderBuf ); in allocateRespHeaderBuf()
575 pReq->m_pRespHeaderBuf = p; in allocateRespHeaderBuf()
576 pReq->m_pRespHeaderBufEnd = p + size; in allocateRespHeaderBuf()
686 static inline void fixEndian( LSAPI_Request * pReq ) in fixEndian() argument
688 struct lsapi_req_header *p= pReq->m_pHeader; in fixEndian()
701 static void fixHeaderIndexEndian( LSAPI_Request * pReq ) in fixHeaderIndexEndian() argument
706 if ( pReq->m_pHeaderIndex->m_headerOff[i] ) in fixHeaderIndexEndian()
709 char * p = (char *)(&pReq->m_pHeaderIndex->m_headerLen[i]); in fixHeaderIndexEndian()
713 swapIntEndian( &pReq->m_pHeaderIndex->m_headerOff[i] ); in fixHeaderIndexEndian()
716 if ( pReq->m_pHeader->m_cntUnknownHeaders > 0 ) in fixHeaderIndexEndian()
719 pCur = pReq->m_pUnknownHeader; in fixHeaderIndexEndian()
720 pEnd = pCur + pReq->m_pHeader->m_cntUnknownHeaders; in fixHeaderIndexEndian()
733 static int validateHeaders( LSAPI_Request * pReq ) in validateHeaders() argument
735 int totalLen = pReq->m_pHeader->m_httpHeaderLen; in validateHeaders()
739 if ( pReq->m_pHeaderIndex->m_headerOff[i] ) in validateHeaders()
741 if (pReq->m_pHeaderIndex->m_headerOff[i] > totalLen in validateHeaders()
742 || pReq->m_pHeaderIndex->m_headerLen[i] in validateHeaders()
743 + pReq->m_pHeaderIndex->m_headerOff[i] > totalLen) in validateHeaders()
747 if (pReq->m_pHeader->m_cntUnknownHeaders > 0) in validateHeaders()
750 pCur = pReq->m_pUnknownHeader; in validateHeaders()
751 pEnd = pCur + pReq->m_pHeader->m_cntUnknownHeaders; in validateHeaders()
898 static int LSAPI_perror_r( LSAPI_Request * pReq, const char * pErr1, const char *pErr2 ) in LSAPI_perror_r() argument
906 if ( pReq ) in LSAPI_perror_r()
907 LSAPI_Write_Stderr_r( pReq, achError, n ); in LSAPI_perror_r()
914 static int lsapi_lve_error( LSAPI_Request * pReq ) in lsapi_lve_error() argument
933 LSAPI_ErrResponse_r( pReq, 508, headers, achBody, sizeof( achBody ) - 1 ); in lsapi_lve_error()
938 static int lsapi_enterLVE( LSAPI_Request * pReq, uid_t uid ) in lsapi_enterLVE() argument
949 LSAPI_perror_r(pReq, "LSAPI: lve_enter() failure, reached resource limit.", NULL ); in lsapi_enterLVE()
950 lsapi_lve_error( pReq ); in lsapi_enterLVE()
960 static int lsapi_jailLVE( LSAPI_Request * pReq, uid_t uid, struct passwd * pw ) in lsapi_jailLVE() argument
970 LSAPI_perror_r( pReq, "LSAPI: jail() failure.", NULL ); in lsapi_jailLVE()
1006 static int setUID_LVE(LSAPI_Request * pReq, uid_t uid, gid_t gid, const char * pChroot) in setUID_LVE() argument
1014 if( lsapi_enterLVE( pReq, uid ) == -1 ) in setUID_LVE()
1018 rv = lsapi_jailLVE( pReq, uid, pw ); in setUID_LVE()
1044 LSAPI_perror_r(pReq, "LSAPI: setgid()", NULL); in setUID_LVE()
1052 LSAPI_perror_r(pReq, "LSAPI: initgroups()", NULL); in setUID_LVE()
1061 LSAPI_perror_r(pReq, "LSAPI: setgroups()", NULL); in setUID_LVE()
1069 LSAPI_perror_r(pReq, "LSAPI: chroot()", NULL); in setUID_LVE()
1076 LSAPI_perror_r(pReq, "LSAPI: setuid()", NULL); in setUID_LVE()
1086 static int lsapi_suexec_auth( LSAPI_Request *pReq, in lsapi_suexec_auth() argument
1105 static int lsapi_changeUGid( LSAPI_Request * pReq ) in lsapi_changeUGid() argument
1121 i = pReq->m_pHeader->m_cntSpecialEnv - 1; in lsapi_changeUGid()
1124 pEnv = pReq->m_pSpecialEnvList + i; in lsapi_changeUGid()
1128 --pReq->m_pHeader->m_cntSpecialEnv; in lsapi_changeUGid()
1133 --pReq->m_pHeader->m_cntSpecialEnv; in lsapi_changeUGid()
1143 …if ( pEnv&& lsapi_suexec_auth( pReq, pAuth->pValue, pAuth->valLen, pEnv->pValue, pEnv->valLen ) ==… in lsapi_changeUGid()
1169 if ( setUID_LVE( pReq, uid, gid, pChroot ) == -1 ) in lsapi_changeUGid()
1176 if ( pReq->m_fdListen != -1 ) in lsapi_changeUGid()
1178 close( pReq->m_fdListen ); in lsapi_changeUGid()
1179 pReq->m_fdListen = -1; in lsapi_changeUGid()
1182 pStderrLog = LSAPI_GetEnv_r( pReq, "LSAPI_STDERR_LOG"); in lsapi_changeUGid()
1191 static int parseContentLenFromHeader(LSAPI_Request * pReq) in parseContentLenFromHeader() argument
1193 const char * pContentLen = LSAPI_GetHeader_r( pReq, H_CONTENT_LENGTH ); in parseContentLenFromHeader()
1195 pReq->m_reqBodyLen = strtoll( pContentLen, NULL, 10 ); in parseContentLenFromHeader()
1200 static int parseRequest( LSAPI_Request * pReq, int totalLen ) in parseRequest() argument
1203 char * pBegin = pReq->m_pReqBuf + sizeof( struct lsapi_req_header ); in parseRequest()
1204 char * pEnd = pReq->m_pReqBuf + totalLen; in parseRequest()
1206 pReq->m_pHeader->m_pktHeader.m_flag & LSAPI_ENDIAN_BIT ) ); in parseRequest()
1209 fixEndian( pReq ); in parseRequest()
1211 if ( (pReq->m_specialEnvListSize < pReq->m_pHeader->m_cntSpecialEnv )&& in parseRequest()
1212 allocateEnvList( &pReq->m_pSpecialEnvList, in parseRequest()
1213 &pReq->m_specialEnvListSize, in parseRequest()
1214 pReq->m_pHeader->m_cntSpecialEnv ) == -1 ) in parseRequest()
1216 if ( (pReq->m_envListSize < pReq->m_pHeader->m_cntEnv )&& in parseRequest()
1217 allocateEnvList( &pReq->m_pEnvList, &pReq->m_envListSize, in parseRequest()
1218 pReq->m_pHeader->m_cntEnv ) == -1 ) in parseRequest()
1221 if ( parseEnv( pReq->m_pSpecialEnvList, in parseRequest()
1222 pReq->m_pHeader->m_cntSpecialEnv, in parseRequest()
1225 if ( parseEnv( pReq->m_pEnvList, pReq->m_pHeader->m_cntEnv, in parseRequest()
1228 if (pReq->m_pHeader->m_scriptFileOff < 0 in parseRequest()
1229 || pReq->m_pHeader->m_scriptFileOff >= totalLen in parseRequest()
1230 || pReq->m_pHeader->m_scriptNameOff < 0 in parseRequest()
1231 || pReq->m_pHeader->m_scriptNameOff >= totalLen in parseRequest()
1232 || pReq->m_pHeader->m_queryStringOff < 0 in parseRequest()
1233 || pReq->m_pHeader->m_queryStringOff >= totalLen in parseRequest()
1234 || pReq->m_pHeader->m_requestMethodOff < 0 in parseRequest()
1235 || pReq->m_pHeader->m_requestMethodOff >= totalLen) in parseRequest()
1240 pReq->m_pScriptFile = pReq->m_pReqBuf + pReq->m_pHeader->m_scriptFileOff; in parseRequest()
1241 pReq->m_pScriptName = pReq->m_pReqBuf + pReq->m_pHeader->m_scriptNameOff; in parseRequest()
1242 pReq->m_pQueryString = pReq->m_pReqBuf + pReq->m_pHeader->m_queryStringOff; in parseRequest()
1243 pReq->m_pRequestMethod = pReq->m_pReqBuf + pReq->m_pHeader->m_requestMethodOff; in parseRequest()
1245 pBegin = pReq->m_pReqBuf + (( pBegin - pReq->m_pReqBuf + 7 ) & (~0x7)); in parseRequest()
1246 pReq->m_pHeaderIndex = ( struct lsapi_http_header_index * )pBegin; in parseRequest()
1249 pReq->m_pUnknownHeader = (struct lsapi_header_offset *)pBegin; in parseRequest()
1251 pReq->m_pHeader->m_cntUnknownHeaders; in parseRequest()
1253 pReq->m_pHttpHeader = pBegin; in parseRequest()
1254 pBegin += pReq->m_pHeader->m_httpHeaderLen; in parseRequest()
1258 "real: %ld\n", totalLen, pBegin - pReq->m_pReqBuf ); in parseRequest()
1263 fixHeaderIndexEndian( pReq ); in parseRequest()
1266 if (validateHeaders(pReq) == -1) in parseRequest()
1272 pReq->m_reqBodyLen = pReq->m_pHeader->m_reqBodyLen; in parseRequest()
1273 if ( pReq->m_reqBodyLen == -2 ) in parseRequest()
1275 parseContentLenFromHeader(pReq); in parseRequest()
1382 static int readReq( LSAPI_Request * pReq ) in readReq() argument
1386 if ( !pReq ) in readReq()
1388 if ( pReq->m_reqBufSize < 8192 ) in readReq()
1390 if ( allocateBuf( pReq, 8192 ) == -1 ) in readReq()
1394 while ( pReq->m_bufRead < LSAPI_PACKET_HEADER_LEN ) in readReq()
1396 len = lsapi_read( pReq->m_fd, pReq->m_pReqBuf, pReq->m_reqBufSize ); in readReq()
1399 pReq->m_bufRead += len; in readReq()
1401 pReq->m_reqState = LSAPI_ST_REQ_HEADER; in readReq()
1403 packetLen = verifyHeader( &pReq->m_pHeader->m_pktHeader, LSAPI_BEGIN_REQUEST ); in readReq()
1415 if ( packetLen + 1024 > pReq->m_reqBufSize ) in readReq()
1417 if ( allocateBuf( pReq, packetLen + 1024 ) == -1 ) in readReq()
1420 while( packetLen > pReq->m_bufRead ) in readReq()
1422 … len = lsapi_read( pReq->m_fd, pReq->m_pReqBuf + pReq->m_bufRead, packetLen - pReq->m_bufRead ); in readReq()
1425 pReq->m_bufRead += len; in readReq()
1427 if ( parseRequest( pReq, packetLen ) < 0 ) in readReq()
1433 pReq->m_reqState = LSAPI_ST_REQ_BODY | LSAPI_ST_RESP_HEADER; in readReq()
1437 if ( lsapi_changeUGid( pReq ) ) in readReq()
1441 pReq->m_bufProcessed = packetLen; in readReq()
1445 return notify_req_received( pReq->m_fd ); in readReq()
1500 int LSAPI_InitRequest( LSAPI_Request * pReq, int fd ) in LSAPI_InitRequest() argument
1503 if ( !pReq ) in LSAPI_InitRequest()
1505 memset( pReq, 0, sizeof( LSAPI_Request ) ); in LSAPI_InitRequest()
1506 if ( allocateIovec( pReq, 16 ) == -1 ) in LSAPI_InitRequest()
1508 pReq->m_pRespBuf = pReq->m_pRespBufPos = (char *)malloc( LSAPI_RESP_BUF_SIZE ); in LSAPI_InitRequest()
1509 if ( !pReq->m_pRespBuf ) in LSAPI_InitRequest()
1511 pReq->m_pRespBufEnd = pReq->m_pRespBuf + LSAPI_RESP_BUF_SIZE; in LSAPI_InitRequest()
1512 pReq->m_pIovecCur = pReq->m_pIovecToWrite = pReq->m_pIovec + 1; in LSAPI_InitRequest()
1513 pReq->m_respPktHeaderEnd = &pReq->m_respPktHeader[5]; in LSAPI_InitRequest()
1514 if ( allocateRespHeaderBuf( pReq, LSAPI_INIT_RESP_HEADER_LEN ) == -1 ) in LSAPI_InitRequest()
1526 pReq->m_fdListen = -1; in LSAPI_InitRequest()
1527 pReq->m_fd = fd; in LSAPI_InitRequest()
1531 pReq->m_fdListen = fd; in LSAPI_InitRequest()
1532 pReq->m_fd = -1; in LSAPI_InitRequest()
1545 int LSAPI_Is_Listen_r( LSAPI_Request * pReq) in LSAPI_Is_Listen_r() argument
1547 return pReq->m_fdListen != -1; in LSAPI_Is_Listen_r()
1551 int LSAPI_Accept_r( LSAPI_Request * pReq ) in LSAPI_Accept_r() argument
1557 if ( !pReq ) in LSAPI_Accept_r()
1559 if ( LSAPI_Finish_r( pReq ) == -1 ) in LSAPI_Accept_r()
1561 lsapi_set_nblock( pReq->m_fdListen , 0 ); in LSAPI_Accept_r()
1564 if ( pReq->m_fd == -1 ) in LSAPI_Accept_r()
1566 if ( pReq->m_fdListen != -1) in LSAPI_Accept_r()
1569 pReq->m_fd = accept( pReq->m_fdListen, in LSAPI_Accept_r()
1571 if ( pReq->m_fd == -1 ) in LSAPI_Accept_r()
1585 lsapi_set_nblock( pReq->m_fd , 0 ); in LSAPI_Accept_r()
1588 setsockopt(pReq->m_fd, IPPROTO_TCP, TCP_NODELAY, in LSAPI_Accept_r()
1594 if ( notify_req_received( pReq->m_fd ) == -1 ) in LSAPI_Accept_r()
1601 if ( !readReq( pReq ) ) in LSAPI_Accept_r()
1604 lsapi_close_connection(pReq); in LSAPI_Accept_r()
1605 LSAPI_Reset_r( pReq ); in LSAPI_Accept_r()
1618 int LSAPI_Finish_r( LSAPI_Request * pReq ) in LSAPI_Finish_r() argument
1621 if ( !pReq ) in LSAPI_Finish_r()
1623 if (pReq->m_reqState) in LSAPI_Finish_r()
1625 if ( pReq->m_fd != -1 ) in LSAPI_Finish_r()
1627 if ( pReq->m_reqState & LSAPI_ST_RESP_HEADER ) in LSAPI_Finish_r()
1629 LSAPI_FinalizeRespHeaders_r( pReq ); in LSAPI_Finish_r()
1631 if ( pReq->m_pRespBufPos != pReq->m_pRespBuf ) in LSAPI_Finish_r()
1633 Flush_RespBuf_r( pReq ); in LSAPI_Finish_r()
1636 pReq->m_pIovecCur->iov_base = (void *)finish_close; in LSAPI_Finish_r()
1637 pReq->m_pIovecCur->iov_len = LSAPI_PACKET_HEADER_LEN; in LSAPI_Finish_r()
1638 pReq->m_totalLen += LSAPI_PACKET_HEADER_LEN; in LSAPI_Finish_r()
1639 ++pReq->m_pIovecCur; in LSAPI_Finish_r()
1640 LSAPI_Flush_r( pReq ); in LSAPI_Finish_r()
1642 LSAPI_Reset_r( pReq ); in LSAPI_Finish_r()
1648 int LSAPI_End_Response_r(LSAPI_Request * pReq) in LSAPI_End_Response_r() argument
1650 if (!pReq) in LSAPI_End_Response_r()
1652 if (pReq->m_reqState & LSAPI_ST_BACKGROUND) in LSAPI_End_Response_r()
1654 if (pReq->m_reqState) in LSAPI_End_Response_r()
1656 if ( pReq->m_fd != -1 ) in LSAPI_End_Response_r()
1658 if ( pReq->m_reqState & LSAPI_ST_RESP_HEADER ) in LSAPI_End_Response_r()
1660 if ( pReq->m_pRespHeaderBufPos <= pReq->m_pRespHeaderBuf ) in LSAPI_End_Response_r()
1663 LSAPI_FinalizeRespHeaders_r( pReq ); in LSAPI_End_Response_r()
1665 if ( pReq->m_pRespBufPos != pReq->m_pRespBuf ) in LSAPI_End_Response_r()
1667 Flush_RespBuf_r( pReq ); in LSAPI_End_Response_r()
1670 pReq->m_pIovecCur->iov_base = (void *)finish_close; in LSAPI_End_Response_r()
1671 pReq->m_pIovecCur->iov_len = LSAPI_PACKET_HEADER_LEN << 1; in LSAPI_End_Response_r()
1672 pReq->m_totalLen += LSAPI_PACKET_HEADER_LEN << 1; in LSAPI_End_Response_r()
1673 ++pReq->m_pIovecCur; in LSAPI_End_Response_r()
1674 LSAPI_Flush_r( pReq ); in LSAPI_End_Response_r()
1675 lsapi_close_connection(pReq); in LSAPI_End_Response_r()
1677 pReq->m_reqState |= LSAPI_ST_BACKGROUND; in LSAPI_End_Response_r()
1683 void LSAPI_Reset_r( LSAPI_Request * pReq ) in LSAPI_Reset_r() argument
1685 pReq->m_pRespBufPos = pReq->m_pRespBuf; in LSAPI_Reset_r()
1686 pReq->m_pIovecCur = pReq->m_pIovecToWrite = pReq->m_pIovec + 1; in LSAPI_Reset_r()
1687 pReq->m_pRespHeaderBufPos = pReq->m_pRespHeaderBuf; in LSAPI_Reset_r()
1689 memset( &pReq->m_pHeaderIndex, 0, in LSAPI_Reset_r()
1690 (char *)(pReq->m_respHeaderLen) - (char *)&pReq->m_pHeaderIndex ); in LSAPI_Reset_r()
1694 int LSAPI_Release_r( LSAPI_Request * pReq ) in LSAPI_Release_r() argument
1696 if ( pReq->m_pReqBuf ) in LSAPI_Release_r()
1697 free( pReq->m_pReqBuf ); in LSAPI_Release_r()
1698 if ( pReq->m_pSpecialEnvList ) in LSAPI_Release_r()
1699 free( pReq->m_pSpecialEnvList ); in LSAPI_Release_r()
1700 if ( pReq->m_pEnvList ) in LSAPI_Release_r()
1701 free( pReq->m_pEnvList ); in LSAPI_Release_r()
1702 if ( pReq->m_pRespHeaderBuf ) in LSAPI_Release_r()
1703 free( pReq->m_pRespHeaderBuf ); in LSAPI_Release_r()
1708 char * LSAPI_GetHeader_r( LSAPI_Request * pReq, int headerIndex ) in LSAPI_GetHeader_r() argument
1711 if ( !pReq || ((unsigned int)headerIndex > H_TRANSFER_ENCODING) ) in LSAPI_GetHeader_r()
1713 off = pReq->m_pHeaderIndex->m_headerOff[ headerIndex ]; in LSAPI_GetHeader_r()
1716 if ( *(pReq->m_pHttpHeader + off in LSAPI_GetHeader_r()
1717 + pReq->m_pHeaderIndex->m_headerLen[ headerIndex ]) ) in LSAPI_GetHeader_r()
1719 *( pReq->m_pHttpHeader + off in LSAPI_GetHeader_r()
1720 + pReq->m_pHeaderIndex->m_headerLen[ headerIndex ]) = 0; in LSAPI_GetHeader_r()
1722 return pReq->m_pHttpHeader + off; in LSAPI_GetHeader_r()
1726 static int readBodyToReqBuf( LSAPI_Request * pReq ) in readBodyToReqBuf() argument
1729 ssize_t len = pReq->m_bufRead - pReq->m_bufProcessed; in readBodyToReqBuf()
1732 pReq->m_bufRead = pReq->m_bufProcessed = pReq->m_pHeader->m_pktHeader.m_packetLen.m_iLen; in readBodyToReqBuf()
1734 bodyLeft = pReq->m_reqBodyLen - pReq->m_reqBodyRead; in readBodyToReqBuf()
1735 len = pReq->m_reqBufSize - pReq->m_bufRead; in readBodyToReqBuf()
1741 len = lsapi_read( pReq->m_fd, pReq->m_pReqBuf + pReq->m_bufRead, len ); in readBodyToReqBuf()
1743 pReq->m_bufRead += len; in readBodyToReqBuf()
1748 int LSAPI_ReqBodyGetChar_r( LSAPI_Request * pReq ) in LSAPI_ReqBodyGetChar_r() argument
1750 if (!pReq || (pReq->m_fd ==-1) ) in LSAPI_ReqBodyGetChar_r()
1752 if ( pReq->m_bufProcessed >= pReq->m_bufRead ) in LSAPI_ReqBodyGetChar_r()
1754 if ( readBodyToReqBuf( pReq ) <= 0 ) in LSAPI_ReqBodyGetChar_r()
1757 ++pReq->m_reqBodyRead; in LSAPI_ReqBodyGetChar_r()
1758 return (unsigned char)*(pReq->m_pReqBuf + pReq->m_bufProcessed++); in LSAPI_ReqBodyGetChar_r()
1762 int LSAPI_ReqBodyGetLine_r( LSAPI_Request * pReq, char * pBuf, size_t bufLen, int *getLF ) in LSAPI_ReqBodyGetLine_r() argument
1770 if (!pReq || pReq->m_fd == -1 || !pBuf || !getLF) in LSAPI_ReqBodyGetLine_r()
1776 len = pReq->m_bufRead - pReq->m_bufProcessed; in LSAPI_ReqBodyGetLine_r()
1779 if ( (len = readBodyToReqBuf( pReq )) <= 0 ) in LSAPI_ReqBodyGetLine_r()
1787 pCur = pReq->m_pReqBuf + pReq->m_bufProcessed; in LSAPI_ReqBodyGetLine_r()
1793 pReq->m_bufProcessed += len; in LSAPI_ReqBodyGetLine_r()
1795 pReq->m_reqBodyRead += len; in LSAPI_ReqBodyGetLine_r()
1809 ssize_t LSAPI_ReadReqBody_r( LSAPI_Request * pReq, char * pBuf, size_t bufLen ) in LSAPI_ReadReqBody_r() argument
1814 if (!pReq || pReq->m_fd == -1 || !pBuf || (ssize_t)bufLen < 0) in LSAPI_ReadReqBody_r()
1817 total = pReq->m_reqBodyLen - pReq->m_reqBodyRead; in LSAPI_ReadReqBody_r()
1825 len = pReq->m_bufRead - pReq->m_bufProcessed; in LSAPI_ReadReqBody_r()
1830 memmove( pBuf, pReq->m_pReqBuf + pReq->m_bufProcessed, len ); in LSAPI_ReadReqBody_r()
1831 pReq->m_bufProcessed += len; in LSAPI_ReadReqBody_r()
1838 len = lsapi_read( pReq->m_fd, pBuf, bufLen ); in LSAPI_ReadReqBody_r()
1852 pReq->m_reqBodyRead += total; in LSAPI_ReadReqBody_r()
1858 ssize_t LSAPI_Write_r( LSAPI_Request * pReq, const char * pBuf, size_t len ) in LSAPI_Write_r() argument
1868 if (!pReq || !pBuf) in LSAPI_Write_r()
1870 if (pReq->m_reqState & LSAPI_ST_BACKGROUND) in LSAPI_Write_r()
1872 if (pReq->m_fd == -1) in LSAPI_Write_r()
1874 if ( pReq->m_reqState & LSAPI_ST_RESP_HEADER ) in LSAPI_Write_r()
1876 LSAPI_FinalizeRespHeaders_r( pReq ); in LSAPI_Write_r()
1888 pReq->m_reqState |= LSAPI_ST_RESP_BODY; in LSAPI_Write_r()
1890 if ( ((ssize_t)len - skip) < pReq->m_pRespBufEnd - pReq->m_pRespBufPos ) in LSAPI_Write_r()
1892 memmove( pReq->m_pRespBufPos, pBuf + skip, len - skip ); in LSAPI_Write_r()
1893 pReq->m_pRespBufPos += len - skip; in LSAPI_Write_r()
1898 pHeader = pReq->m_respPktHeader; in LSAPI_Write_r()
1901 bufLen = pReq->m_pRespBufPos - pReq->m_pRespBuf; in LSAPI_Write_r()
1914 pReq->m_totalLen += packetLen + LSAPI_PACKET_HEADER_LEN; in LSAPI_Write_r()
1916 pReq->m_pIovecCur->iov_base = (void *)pHeader; in LSAPI_Write_r()
1917 pReq->m_pIovecCur->iov_len = LSAPI_PACKET_HEADER_LEN; in LSAPI_Write_r()
1918 ++pReq->m_pIovecCur; in LSAPI_Write_r()
1922 pReq->m_pIovecCur->iov_base = (void *)pReq->m_pRespBuf; in LSAPI_Write_r()
1923 pReq->m_pIovecCur->iov_len = bufLen; in LSAPI_Write_r()
1924 pReq->m_pRespBufPos = pReq->m_pRespBuf; in LSAPI_Write_r()
1925 ++pReq->m_pIovecCur; in LSAPI_Write_r()
1929 pReq->m_pIovecCur->iov_base = (void *)p; in LSAPI_Write_r()
1930 pReq->m_pIovecCur->iov_len = toWrite; in LSAPI_Write_r()
1931 ++pReq->m_pIovecCur; in LSAPI_Write_r()
1934 if ( pHeader >= pReq->m_respPktHeaderEnd - 1) in LSAPI_Write_r()
1936 if ( LSAPI_Flush_r( pReq ) == -1 ) in LSAPI_Write_r()
1938 pHeader = pReq->m_respPktHeader; in LSAPI_Write_r()
1941 if ( pHeader != pReq->m_respPktHeader ) in LSAPI_Write_r()
1942 if ( LSAPI_Flush_r( pReq ) == -1 ) in LSAPI_Write_r()
2019 ssize_t LSAPI_sendfile_r( LSAPI_Request * pReq, int fdIn, off_t* off, size_t size ) in LSAPI_sendfile_r() argument
2021 struct lsapi_packet_header * pHeader = pReq->m_respPktHeader; in LSAPI_sendfile_r()
2022 if ( !pReq || (pReq->m_fd == -1) || fdIn == -1 ) in LSAPI_sendfile_r()
2024 if ( pReq->m_reqState & LSAPI_ST_RESP_HEADER ) in LSAPI_sendfile_r()
2026 LSAPI_FinalizeRespHeaders_r( pReq ); in LSAPI_sendfile_r()
2028 pReq->m_reqState |= LSAPI_ST_RESP_BODY; in LSAPI_sendfile_r()
2030 LSAPI_Flush_r(pReq); in LSAPI_sendfile_r()
2036 …if (write(pReq->m_fd, (const char *) pHeader, LSAPI_PACKET_HEADER_LEN ) != LSAPI_PACKET_HEADER_LE… in LSAPI_sendfile_r()
2039 return gsendfile( pReq->m_fd, fdIn, off, size ); in LSAPI_sendfile_r()
2043 void Flush_RespBuf_r( LSAPI_Request * pReq ) in Flush_RespBuf_r() argument
2045 struct lsapi_packet_header * pHeader = pReq->m_respPktHeader; in Flush_RespBuf_r()
2046 int bufLen = pReq->m_pRespBufPos - pReq->m_pRespBuf; in Flush_RespBuf_r()
2047 pReq->m_reqState |= LSAPI_ST_RESP_BODY; in Flush_RespBuf_r()
2050 pReq->m_totalLen += bufLen + LSAPI_PACKET_HEADER_LEN; in Flush_RespBuf_r()
2052 pReq->m_pIovecCur->iov_base = (void *)pHeader; in Flush_RespBuf_r()
2053 pReq->m_pIovecCur->iov_len = LSAPI_PACKET_HEADER_LEN; in Flush_RespBuf_r()
2054 ++pReq->m_pIovecCur; in Flush_RespBuf_r()
2058 pReq->m_pIovecCur->iov_base = (void *)pReq->m_pRespBuf; in Flush_RespBuf_r()
2059 pReq->m_pIovecCur->iov_len = bufLen; in Flush_RespBuf_r()
2060 pReq->m_pRespBufPos = pReq->m_pRespBuf; in Flush_RespBuf_r()
2061 ++pReq->m_pIovecCur; in Flush_RespBuf_r()
2067 int LSAPI_Flush_r( LSAPI_Request * pReq ) in LSAPI_Flush_r() argument
2071 if ( !pReq ) in LSAPI_Flush_r()
2073 n = pReq->m_pIovecCur - pReq->m_pIovecToWrite; in LSAPI_Flush_r()
2074 if (( 0 == n )&&( pReq->m_pRespBufPos == pReq->m_pRespBuf )) in LSAPI_Flush_r()
2076 if ( pReq->m_fd == -1 ) in LSAPI_Flush_r()
2078 pReq->m_pRespBufPos = pReq->m_pRespBuf; in LSAPI_Flush_r()
2079 pReq->m_totalLen = 0; in LSAPI_Flush_r()
2080 pReq->m_pIovecCur = pReq->m_pIovecToWrite = pReq->m_pIovec; in LSAPI_Flush_r()
2083 if ( pReq->m_reqState & LSAPI_ST_RESP_HEADER ) in LSAPI_Flush_r()
2085 LSAPI_FinalizeRespHeaders_r( pReq ); in LSAPI_Flush_r()
2087 if ( pReq->m_pRespBufPos != pReq->m_pRespBuf ) in LSAPI_Flush_r()
2089 Flush_RespBuf_r( pReq ); in LSAPI_Flush_r()
2092 n = pReq->m_pIovecCur - pReq->m_pIovecToWrite; in LSAPI_Flush_r()
2096 ret = lsapi_writev( pReq->m_fd, &pReq->m_pIovecToWrite, in LSAPI_Flush_r()
2097 n, pReq->m_totalLen ); in LSAPI_Flush_r()
2098 if ( ret < pReq->m_totalLen ) in LSAPI_Flush_r()
2100 lsapi_close_connection(pReq); in LSAPI_Flush_r()
2103 pReq->m_totalLen = 0; in LSAPI_Flush_r()
2104 pReq->m_pIovecCur = pReq->m_pIovecToWrite = pReq->m_pIovec; in LSAPI_Flush_r()
2110 ssize_t LSAPI_Write_Stderr_r( LSAPI_Request * pReq, const char * pBuf, size_t len ) in LSAPI_Write_Stderr_r() argument
2121 if ( !pReq ) in LSAPI_Write_Stderr_r()
2123 if (s_stderr_log_path || pReq->m_fd == -1 || pReq->m_fd == pReq->m_fdListen) in LSAPI_Write_Stderr_r()
2125 if ( pReq->m_pRespBufPos != pReq->m_pRespBuf ) in LSAPI_Write_Stderr_r()
2127 LSAPI_Flush_r( pReq ); in LSAPI_Write_Stderr_r()
2151 ret = lsapi_writev( pReq->m_fd, &pIov, in LSAPI_Write_Stderr_r()
2155 lsapi_close_connection(pReq); in LSAPI_Write_Stderr_r()
2163 static char * GetHeaderVar( LSAPI_Request * pReq, const char * name ) in GetHeaderVar() argument
2169 if ( pReq->m_pHeaderIndex->m_headerOff[i] ) in GetHeaderVar()
2173 pValue = pReq->m_pHttpHeader in GetHeaderVar()
2174 + pReq->m_pHeaderIndex->m_headerOff[i]; in GetHeaderVar()
2175 if ( *(pValue + pReq->m_pHeaderIndex->m_headerLen[i]) != '\0') in GetHeaderVar()
2177 *(pValue + pReq->m_pHeaderIndex->m_headerLen[i]) = '\0'; in GetHeaderVar()
2183 if ( pReq->m_pHeader->m_cntUnknownHeaders > 0 ) in GetHeaderVar()
2190 pCur = pReq->m_pUnknownHeader; in GetHeaderVar()
2191 pEnd = pCur + pReq->m_pHeader->m_cntUnknownHeaders; in GetHeaderVar()
2194 pKey = pReq->m_pHttpHeader + pCur->nameOff; in GetHeaderVar()
2208 pValue = pReq->m_pHttpHeader + pCur->valueOff; in GetHeaderVar()
2223 char * LSAPI_GetEnv_r( LSAPI_Request * pReq, const char * name ) in LSAPI_GetEnv_r() argument
2225 struct LSAPI_key_value_pair * pBegin = pReq->m_pEnvList; in LSAPI_GetEnv_r()
2226 struct LSAPI_key_value_pair * pEnd = pBegin + pReq->m_pHeader->m_cntEnv; in LSAPI_GetEnv_r()
2227 if ( !pReq || !name ) in LSAPI_GetEnv_r()
2231 return GetHeaderVar( pReq, name ); in LSAPI_GetEnv_r()
2259 int LSAPI_ForeachOrgHeader_r( LSAPI_Request * pReq, in LSAPI_ForeachOrgHeader_r() argument
2269 if ( !pReq || !fn ) in LSAPI_ForeachOrgHeader_r()
2272 if ( !pReq->m_pHeaderIndex ) in LSAPI_ForeachOrgHeader_r()
2277 if ( pReq->m_pHeaderIndex->m_headerOff[i] ) in LSAPI_ForeachOrgHeader_r()
2279 len = pReq->m_pHeaderIndex->m_headerLen[i]; in LSAPI_ForeachOrgHeader_r()
2280 pValue = pReq->m_pHttpHeader + pReq->m_pHeaderIndex->m_headerOff[i]; in LSAPI_ForeachOrgHeader_r()
2294 if ( pReq->m_pHeader->m_cntUnknownHeaders > 0 ) in LSAPI_ForeachOrgHeader_r()
2299 pCur = pReq->m_pUnknownHeader; in LSAPI_ForeachOrgHeader_r()
2300 pEnd = pCur + pReq->m_pHeader->m_cntUnknownHeaders; in LSAPI_ForeachOrgHeader_r()
2303 pKey = pReq->m_pHttpHeader + pCur->nameOff; in LSAPI_ForeachOrgHeader_r()
2307 pValue = pReq->m_pHttpHeader + pCur->valueOff; in LSAPI_ForeachOrgHeader_r()
2335 int LSAPI_ForeachHeader_r( LSAPI_Request * pReq, in LSAPI_ForeachHeader_r() argument
2343 if ( !pReq || !fn ) in LSAPI_ForeachHeader_r()
2347 if ( pReq->m_pHeaderIndex->m_headerOff[i] ) in LSAPI_ForeachHeader_r()
2349 len = pReq->m_pHeaderIndex->m_headerLen[i]; in LSAPI_ForeachHeader_r()
2350 pValue = pReq->m_pHttpHeader + pReq->m_pHeaderIndex->m_headerOff[i]; in LSAPI_ForeachHeader_r()
2359 if ( pReq->m_pHeader->m_cntUnknownHeaders > 0 ) in LSAPI_ForeachHeader_r()
2367 pCur = pReq->m_pUnknownHeader; in LSAPI_ForeachHeader_r()
2368 pEnd = pCur + pReq->m_pHeader->m_cntUnknownHeaders; in LSAPI_ForeachHeader_r()
2371 pKey = pReq->m_pHttpHeader + pCur->nameOff; in LSAPI_ForeachHeader_r()
2390 pValue = pReq->m_pHttpHeader + pCur->valueOff; in LSAPI_ForeachHeader_r()
2399 return count + pReq->m_pHeader->m_cntUnknownHeaders; in LSAPI_ForeachHeader_r()
2422 int LSAPI_ForeachEnv_r( LSAPI_Request * pReq, in LSAPI_ForeachEnv_r() argument
2425 if ( !pReq || !fn ) in LSAPI_ForeachEnv_r()
2427 if ( pReq->m_pHeader->m_cntEnv > 0 ) in LSAPI_ForeachEnv_r()
2429 return EnvForeach( pReq->m_pEnvList, pReq->m_pHeader->m_cntEnv, in LSAPI_ForeachEnv_r()
2436 int LSAPI_ForeachSpecialEnv_r( LSAPI_Request * pReq, in LSAPI_ForeachSpecialEnv_r() argument
2439 if ( !pReq || !fn ) in LSAPI_ForeachSpecialEnv_r()
2441 if ( pReq->m_pHeader->m_cntSpecialEnv > 0 ) in LSAPI_ForeachSpecialEnv_r()
2443 return EnvForeach( pReq->m_pSpecialEnvList, in LSAPI_ForeachSpecialEnv_r()
2444 pReq->m_pHeader->m_cntSpecialEnv, in LSAPI_ForeachSpecialEnv_r()
2452 int LSAPI_FinalizeRespHeaders_r( LSAPI_Request * pReq ) in LSAPI_FinalizeRespHeaders_r() argument
2454 if ( !pReq || !pReq->m_pIovec ) in LSAPI_FinalizeRespHeaders_r()
2456 if ( !( pReq->m_reqState & LSAPI_ST_RESP_HEADER ) ) in LSAPI_FinalizeRespHeaders_r()
2458 pReq->m_reqState &= ~LSAPI_ST_RESP_HEADER; in LSAPI_FinalizeRespHeaders_r()
2459 if ( pReq->m_pRespHeaderBufPos > pReq->m_pRespHeaderBuf ) in LSAPI_FinalizeRespHeaders_r()
2461 pReq->m_pIovecCur->iov_base = (void *)pReq->m_pRespHeaderBuf; in LSAPI_FinalizeRespHeaders_r()
2462 pReq->m_pIovecCur->iov_len = pReq->m_pRespHeaderBufPos - pReq->m_pRespHeaderBuf; in LSAPI_FinalizeRespHeaders_r()
2463 pReq->m_totalLen += pReq->m_pIovecCur->iov_len; in LSAPI_FinalizeRespHeaders_r()
2464 ++pReq->m_pIovecCur; in LSAPI_FinalizeRespHeaders_r()
2467 pReq->m_pIovec->iov_len = sizeof( struct lsapi_resp_header) in LSAPI_FinalizeRespHeaders_r()
2468 + pReq->m_respHeader.m_respInfo.m_cntHeaders * sizeof( short ); in LSAPI_FinalizeRespHeaders_r()
2469 pReq->m_totalLen += pReq->m_pIovec->iov_len; in LSAPI_FinalizeRespHeaders_r()
2471 lsapi_buildPacketHeader( &pReq->m_respHeader.m_pktHeader, in LSAPI_FinalizeRespHeaders_r()
2472 LSAPI_RESP_HEADER, pReq->m_totalLen ); in LSAPI_FinalizeRespHeaders_r()
2473 pReq->m_pIovec->iov_base = (void *)&pReq->m_respHeader; in LSAPI_FinalizeRespHeaders_r()
2474 pReq->m_pIovecToWrite = pReq->m_pIovec; in LSAPI_FinalizeRespHeaders_r()
2479 int LSAPI_AppendRespHeader2_r( LSAPI_Request * pReq, const char * pHeaderName, in LSAPI_AppendRespHeader2_r() argument
2483 if ( !pReq || !pHeaderName || !pHeaderValue ) in LSAPI_AppendRespHeader2_r()
2485 if ( pReq->m_reqState & LSAPI_ST_RESP_BODY ) in LSAPI_AppendRespHeader2_r()
2487 if ( pReq->m_respHeader.m_respInfo.m_cntHeaders >= LSAPI_MAX_RESP_HEADERS ) in LSAPI_AppendRespHeader2_r()
2515 if ( pReq->m_pRespHeaderBufPos + len + 1 > pReq->m_pRespHeaderBufEnd ) in LSAPI_AppendRespHeader2_r()
2517 int newlen = pReq->m_pRespHeaderBufPos + len + 4096 - pReq->m_pRespHeaderBuf; in LSAPI_AppendRespHeader2_r()
2519 if ( allocateRespHeaderBuf( pReq, newlen ) == -1 ) in LSAPI_AppendRespHeader2_r()
2522 memmove( pReq->m_pRespHeaderBufPos, pHeaderName, nameLen ); in LSAPI_AppendRespHeader2_r()
2523 pReq->m_pRespHeaderBufPos += nameLen; in LSAPI_AppendRespHeader2_r()
2524 *pReq->m_pRespHeaderBufPos++ = ':'; in LSAPI_AppendRespHeader2_r()
2525 memmove( pReq->m_pRespHeaderBufPos, pHeaderValue, valLen ); in LSAPI_AppendRespHeader2_r()
2526 pReq->m_pRespHeaderBufPos += valLen; in LSAPI_AppendRespHeader2_r()
2527 *pReq->m_pRespHeaderBufPos++ = 0; in LSAPI_AppendRespHeader2_r()
2529 pReq->m_respHeaderLen[pReq->m_respHeader.m_respInfo.m_cntHeaders] = len; in LSAPI_AppendRespHeader2_r()
2530 ++pReq->m_respHeader.m_respInfo.m_cntHeaders; in LSAPI_AppendRespHeader2_r()
2535 int LSAPI_AppendRespHeader_r( LSAPI_Request * pReq, const char * pBuf, int len ) in LSAPI_AppendRespHeader_r() argument
2537 if ( !pReq || !pBuf || len <= 0 || len > LSAPI_RESP_HTTP_HEADER_MAX ) in LSAPI_AppendRespHeader_r()
2539 if ( pReq->m_reqState & LSAPI_ST_RESP_BODY ) in LSAPI_AppendRespHeader_r()
2541 if ( pReq->m_respHeader.m_respInfo.m_cntHeaders >= LSAPI_MAX_RESP_HEADERS ) in LSAPI_AppendRespHeader_r()
2553 if ( pReq->m_pRespHeaderBufPos + len + 1 > pReq->m_pRespHeaderBufEnd ) in LSAPI_AppendRespHeader_r()
2555 int newlen = pReq->m_pRespHeaderBufPos + len + 4096 - pReq->m_pRespHeaderBuf; in LSAPI_AppendRespHeader_r()
2557 if ( allocateRespHeaderBuf( pReq, newlen ) == -1 ) in LSAPI_AppendRespHeader_r()
2560 memmove( pReq->m_pRespHeaderBufPos, pBuf, len ); in LSAPI_AppendRespHeader_r()
2561 pReq->m_pRespHeaderBufPos += len; in LSAPI_AppendRespHeader_r()
2562 *pReq->m_pRespHeaderBufPos++ = 0; in LSAPI_AppendRespHeader_r()
2564 pReq->m_respHeaderLen[pReq->m_respHeader.m_respInfo.m_cntHeaders] = len; in LSAPI_AppendRespHeader_r()
2565 ++pReq->m_respHeader.m_respInfo.m_cntHeaders; in LSAPI_AppendRespHeader_r()
3130 LSAPI_Request * pReq ) in lsapi_prefork_server_accept() argument
3246 pReq->m_fd = lsapi_accept( pServer->m_fd ); in lsapi_prefork_server_accept()
3247 if ( pReq->m_fd != -1 ) in lsapi_prefork_server_accept()
3281 lsapi_set_nblock( pReq->m_fd, 0 ); in lsapi_prefork_server_accept()
3287 && pReq->m_fdListen != -1 ) in lsapi_prefork_server_accept()
3289 close( pReq->m_fdListen ); in lsapi_prefork_server_accept()
3290 pReq->m_fdListen = -1; in lsapi_prefork_server_accept()
3299 lsapi_notify_pid( pReq->m_fd ); in lsapi_prefork_server_accept()
3321 close( pReq->m_fd ); in lsapi_prefork_server_accept()
3322 pReq->m_fd = -1; in lsapi_prefork_server_accept()
3348 int LSAPI_Postfork_Child(LSAPI_Request * pReq) in LSAPI_Postfork_Child() argument
3352 __atomic_store_n(&pReq->child_status->m_pid, s_pid, __ATOMIC_SEQ_CST); in LSAPI_Postfork_Child()
3353 s_worker_status = pReq->child_status; in LSAPI_Postfork_Child()
3368 lsapi_set_nblock( pReq->m_fd, 0 ); in LSAPI_Postfork_Child()
3374 && pReq->m_fdListen != -1 ) in LSAPI_Postfork_Child()
3376 close(pReq->m_fdListen); in LSAPI_Postfork_Child()
3377 pReq->m_fdListen = -1; in LSAPI_Postfork_Child()
3381 lsapi_notify_pid(pReq->m_fd); in LSAPI_Postfork_Child()
3389 int LSAPI_Postfork_Parent(LSAPI_Request * pReq) in LSAPI_Postfork_Parent() argument
3392 if (pReq->child_status) in LSAPI_Postfork_Parent()
3395 pReq->child_status->m_tmWaitBegin = curTime; in LSAPI_Postfork_Parent()
3396 pReq->child_status->m_tmStart = curTime; in LSAPI_Postfork_Parent()
3398 close(pReq->m_fd); in LSAPI_Postfork_Parent()
3399 pReq->m_fd = -1; in LSAPI_Postfork_Parent()
3404 int LSAPI_Accept_Before_Fork(LSAPI_Request * pReq) in LSAPI_Accept_Before_Fork() argument
3441 pReq->m_reqState = 0; in LSAPI_Accept_Before_Fork()
3519 pReq->m_fd = lsapi_accept(pServer->m_fd); in LSAPI_Accept_Before_Fork()
3520 if (pReq->m_fd != -1) in LSAPI_Accept_Before_Fork()
3523 pReq->child_status = find_child_status(0); in LSAPI_Accept_Before_Fork()
3548 int LSAPI_Prefork_Accept_r( LSAPI_Request * pReq ) in LSAPI_Prefork_Accept_r() argument
3559 LSAPI_Finish_r( pReq ); in LSAPI_Prefork_Accept_r()
3564 if ( lsapi_prefork_server_accept( g_prefork_server, pReq ) == -1 ) in LSAPI_Prefork_Accept_r()
3572 send_conn_close_notification(pReq->m_fd); in LSAPI_Prefork_Accept_r()
3573 lsapi_close_connection(pReq); in LSAPI_Prefork_Accept_r()
3588 if ( pReq->m_fd != -1 ) in LSAPI_Prefork_Accept_r()
3590 fd = pReq->m_fd; in LSAPI_Prefork_Accept_r()
3592 else if ( pReq->m_fdListen != -1 ) in LSAPI_Prefork_Accept_r()
3593 fd = pReq->m_fdListen; in LSAPI_Prefork_Accept_r()
3610 if (fd == pReq->m_fdListen) in LSAPI_Prefork_Accept_r()
3619 if (fd == pReq->m_fdListen) in LSAPI_Prefork_Accept_r()
3633 if (fd == pReq->m_fdListen) in LSAPI_Prefork_Accept_r()
3667 if ( fd == pReq->m_fdListen ) in LSAPI_Prefork_Accept_r()
3669 pReq->m_fd = lsapi_accept( pReq->m_fdListen ); in LSAPI_Prefork_Accept_r()
3670 if ( pReq->m_fd != -1 ) in LSAPI_Prefork_Accept_r()
3679 fd = pReq->m_fd; in LSAPI_Prefork_Accept_r()
3685 close( pReq->m_fdListen ); in LSAPI_Prefork_Accept_r()
3686 pReq->m_fdListen = -1; in LSAPI_Prefork_Accept_r()
3689 if ( notify_req_received( pReq->m_fd ) == -1 ) in LSAPI_Prefork_Accept_r()
3705 if ( !readReq( pReq ) ) in LSAPI_Prefork_Accept_r()
3718 lsapi_close_connection(pReq); in LSAPI_Prefork_Accept_r()
3719 LSAPI_Reset_r( pReq ); in LSAPI_Prefork_Accept_r()
4089 int LSAPI_ErrResponse_r( LSAPI_Request * pReq, int code, const char ** pRespHeaders, in LSAPI_ErrResponse_r() argument
4092 LSAPI_SetRespStatus_r( pReq, code ); in LSAPI_ErrResponse_r()
4097 LSAPI_AppendRespHeader_r( pReq, *pRespHeaders, strlen( *pRespHeaders ) ); in LSAPI_ErrResponse_r()
4103 LSAPI_Write_r( pReq, pBody, bodyLen ); in LSAPI_ErrResponse_r()
4105 LSAPI_Finish_r( pReq ); in LSAPI_ErrResponse_r()