Lines Matching refs:pReq
180 void Flush_RespBuf_r( LSAPI_Request * pReq );
438 static void lsapi_close_connection(LSAPI_Request *pReq) in lsapi_close_connection() argument
440 if (pReq->m_fd == -1) in lsapi_close_connection()
442 lsapi_close(pReq->m_fd); in lsapi_close_connection()
443 pReq->m_fd = -1; in lsapi_close_connection()
552 static inline int allocateBuf( LSAPI_Request * pReq, int size ) in allocateBuf() argument
554 char * pBuf = (char *)realloc( pReq->m_pReqBuf, size ); in allocateBuf()
557 pReq->m_pReqBuf = pBuf; in allocateBuf()
558 pReq->m_reqBufSize = size; in allocateBuf()
559 pReq->m_pHeader = (struct lsapi_req_header *)pReq->m_pReqBuf; in allocateBuf()
566 static int allocateIovec( LSAPI_Request * pReq, int n ) in allocateIovec() argument
569 pReq->m_pIovec, sizeof(struct iovec) * n ); in allocateIovec()
572 pReq->m_pIovecToWrite = p + ( pReq->m_pIovecToWrite - pReq->m_pIovec ); in allocateIovec()
573 pReq->m_pIovecCur = p + ( pReq->m_pIovecCur - pReq->m_pIovec ); in allocateIovec()
574 pReq->m_pIovec = p; in allocateIovec()
575 pReq->m_pIovecEnd = p + n; in allocateIovec()
580 static int allocateRespHeaderBuf( LSAPI_Request * pReq, int size ) in allocateRespHeaderBuf() argument
582 char * p = (char *)realloc( pReq->m_pRespHeaderBuf, size ); in allocateRespHeaderBuf()
585 pReq->m_pRespHeaderBufPos = p + ( pReq->m_pRespHeaderBufPos - pReq->m_pRespHeaderBuf ); in allocateRespHeaderBuf()
586 pReq->m_pRespHeaderBuf = p; in allocateRespHeaderBuf()
587 pReq->m_pRespHeaderBufEnd = p + size; in allocateRespHeaderBuf()
697 static inline void fixEndian( LSAPI_Request * pReq ) in fixEndian() argument
699 struct lsapi_req_header *p= pReq->m_pHeader; in fixEndian()
712 static void fixHeaderIndexEndian( LSAPI_Request * pReq ) in fixHeaderIndexEndian() argument
717 if ( pReq->m_pHeaderIndex->m_headerOff[i] ) in fixHeaderIndexEndian()
720 char * p = (char *)(&pReq->m_pHeaderIndex->m_headerLen[i]); in fixHeaderIndexEndian()
724 swapIntEndian( &pReq->m_pHeaderIndex->m_headerOff[i] ); in fixHeaderIndexEndian()
727 if ( pReq->m_pHeader->m_cntUnknownHeaders > 0 ) in fixHeaderIndexEndian()
730 pCur = pReq->m_pUnknownHeader; in fixHeaderIndexEndian()
731 pEnd = pCur + pReq->m_pHeader->m_cntUnknownHeaders; in fixHeaderIndexEndian()
744 static int validateHeaders( LSAPI_Request * pReq ) in validateHeaders() argument
746 int totalLen = pReq->m_pHeader->m_httpHeaderLen; in validateHeaders()
750 if ( pReq->m_pHeaderIndex->m_headerOff[i] ) in validateHeaders()
752 if (pReq->m_pHeaderIndex->m_headerOff[i] > totalLen in validateHeaders()
753 || pReq->m_pHeaderIndex->m_headerLen[i] in validateHeaders()
754 + pReq->m_pHeaderIndex->m_headerOff[i] > totalLen) in validateHeaders()
758 if (pReq->m_pHeader->m_cntUnknownHeaders > 0) in validateHeaders()
761 pCur = pReq->m_pUnknownHeader; in validateHeaders()
762 pEnd = pCur + pReq->m_pHeader->m_cntUnknownHeaders; in validateHeaders()
909 static int LSAPI_perror_r( LSAPI_Request * pReq, const char * pErr1, const char *pErr2 ) in LSAPI_perror_r() argument
917 if ( pReq ) in LSAPI_perror_r()
918 LSAPI_Write_Stderr_r( pReq, achError, n ); in LSAPI_perror_r()
926 static int lsapi_lve_error( LSAPI_Request * pReq ) in lsapi_lve_error() argument
945 LSAPI_ErrResponse_r( pReq, 508, headers, achBody, sizeof( achBody ) - 1 ); in lsapi_lve_error()
949 static int lsapi_enterLVE( LSAPI_Request * pReq, uid_t uid ) in lsapi_enterLVE() argument
959 LSAPI_perror_r(pReq, "LSAPI: lve_enter() failure, reached resource limit.", NULL ); in lsapi_enterLVE()
960 lsapi_lve_error( pReq ); in lsapi_enterLVE()
968 static int lsapi_jailLVE( LSAPI_Request * pReq, uid_t uid, struct passwd * pw ) in lsapi_jailLVE() argument
977 LSAPI_perror_r( pReq, "LSAPI: jail() failure.", NULL ); in lsapi_jailLVE()
1011 static int setUID_LVE(LSAPI_Request * pReq, uid_t uid, gid_t gid, const char * pChroot) in setUID_LVE() argument
1019 if( lsapi_enterLVE( pReq, uid ) == -1 ) in setUID_LVE()
1023 rv = lsapi_jailLVE( pReq, uid, pw ); in setUID_LVE()
1049 LSAPI_perror_r(pReq, "LSAPI: setgid()", NULL); in setUID_LVE()
1057 LSAPI_perror_r(pReq, "LSAPI: initgroups()", NULL); in setUID_LVE()
1066 LSAPI_perror_r(pReq, "LSAPI: setgroups()", NULL); in setUID_LVE()
1074 LSAPI_perror_r(pReq, "LSAPI: chroot()", NULL); in setUID_LVE()
1081 LSAPI_perror_r(pReq, "LSAPI: setuid()", NULL); in setUID_LVE()
1091 static int lsapi_suexec_auth( LSAPI_Request *pReq, in lsapi_suexec_auth() argument
1110 static int lsapi_changeUGid( LSAPI_Request * pReq ) in lsapi_changeUGid() argument
1126 i = pReq->m_pHeader->m_cntSpecialEnv - 1; in lsapi_changeUGid()
1129 pEnv = pReq->m_pSpecialEnvList + i; in lsapi_changeUGid()
1133 --pReq->m_pHeader->m_cntSpecialEnv; in lsapi_changeUGid()
1138 --pReq->m_pHeader->m_cntSpecialEnv; in lsapi_changeUGid()
1148 …if ( pEnv&& lsapi_suexec_auth( pReq, pAuth->pValue, pAuth->valLen, pEnv->pValue, pEnv->valLen ) ==… in lsapi_changeUGid()
1174 if ( setUID_LVE( pReq, uid, gid, pChroot ) == -1 ) in lsapi_changeUGid()
1181 if ( pReq->m_fdListen != -1 ) in lsapi_changeUGid()
1183 close( pReq->m_fdListen ); in lsapi_changeUGid()
1184 pReq->m_fdListen = -1; in lsapi_changeUGid()
1187 pStderrLog = LSAPI_GetEnv_r( pReq, "LSAPI_STDERR_LOG"); in lsapi_changeUGid()
1196 static int parseContentLenFromHeader(LSAPI_Request * pReq) in parseContentLenFromHeader() argument
1198 const char * pContentLen = LSAPI_GetHeader_r( pReq, H_CONTENT_LENGTH ); in parseContentLenFromHeader()
1200 pReq->m_reqBodyLen = strtoll( pContentLen, NULL, 10 ); in parseContentLenFromHeader()
1205 static int parseRequest( LSAPI_Request * pReq, int totalLen ) in parseRequest() argument
1208 char * pBegin = pReq->m_pReqBuf + sizeof( struct lsapi_req_header ); in parseRequest()
1209 char * pEnd = pReq->m_pReqBuf + totalLen; in parseRequest()
1211 pReq->m_pHeader->m_pktHeader.m_flag & LSAPI_ENDIAN_BIT ) ); in parseRequest()
1214 fixEndian( pReq ); in parseRequest()
1216 if ( (pReq->m_specialEnvListSize < pReq->m_pHeader->m_cntSpecialEnv )&& in parseRequest()
1217 allocateEnvList( &pReq->m_pSpecialEnvList, in parseRequest()
1218 &pReq->m_specialEnvListSize, in parseRequest()
1219 pReq->m_pHeader->m_cntSpecialEnv ) == -1 ) in parseRequest()
1221 if ( (pReq->m_envListSize < pReq->m_pHeader->m_cntEnv )&& in parseRequest()
1222 allocateEnvList( &pReq->m_pEnvList, &pReq->m_envListSize, in parseRequest()
1223 pReq->m_pHeader->m_cntEnv ) == -1 ) in parseRequest()
1226 if ( parseEnv( pReq->m_pSpecialEnvList, in parseRequest()
1227 pReq->m_pHeader->m_cntSpecialEnv, in parseRequest()
1230 if ( parseEnv( pReq->m_pEnvList, pReq->m_pHeader->m_cntEnv, in parseRequest()
1233 if (pReq->m_pHeader->m_scriptFileOff < 0 in parseRequest()
1234 || pReq->m_pHeader->m_scriptFileOff >= totalLen in parseRequest()
1235 || pReq->m_pHeader->m_scriptNameOff < 0 in parseRequest()
1236 || pReq->m_pHeader->m_scriptNameOff >= totalLen in parseRequest()
1237 || pReq->m_pHeader->m_queryStringOff < 0 in parseRequest()
1238 || pReq->m_pHeader->m_queryStringOff >= totalLen in parseRequest()
1239 || pReq->m_pHeader->m_requestMethodOff < 0 in parseRequest()
1240 || pReq->m_pHeader->m_requestMethodOff >= totalLen) in parseRequest()
1245 pReq->m_pScriptFile = pReq->m_pReqBuf + pReq->m_pHeader->m_scriptFileOff; in parseRequest()
1246 pReq->m_pScriptName = pReq->m_pReqBuf + pReq->m_pHeader->m_scriptNameOff; in parseRequest()
1247 pReq->m_pQueryString = pReq->m_pReqBuf + pReq->m_pHeader->m_queryStringOff; in parseRequest()
1248 pReq->m_pRequestMethod = pReq->m_pReqBuf + pReq->m_pHeader->m_requestMethodOff; in parseRequest()
1250 pBegin = pReq->m_pReqBuf + (( pBegin - pReq->m_pReqBuf + 7 ) & (~0x7)); in parseRequest()
1251 pReq->m_pHeaderIndex = ( struct lsapi_http_header_index * )pBegin; in parseRequest()
1254 pReq->m_pUnknownHeader = (struct lsapi_header_offset *)pBegin; in parseRequest()
1256 pReq->m_pHeader->m_cntUnknownHeaders; in parseRequest()
1258 pReq->m_pHttpHeader = pBegin; in parseRequest()
1259 pBegin += pReq->m_pHeader->m_httpHeaderLen; in parseRequest()
1263 "real: %ld\n", totalLen, pBegin - pReq->m_pReqBuf ); in parseRequest()
1268 fixHeaderIndexEndian( pReq ); in parseRequest()
1271 if (validateHeaders(pReq) == -1) in parseRequest()
1277 pReq->m_reqBodyLen = pReq->m_pHeader->m_reqBodyLen; in parseRequest()
1278 if ( pReq->m_reqBodyLen == -2 ) in parseRequest()
1280 parseContentLenFromHeader(pReq); in parseRequest()
1363 static int readReq( LSAPI_Request * pReq ) in readReq() argument
1367 if ( !pReq ) in readReq()
1369 if ( pReq->m_reqBufSize < 8192 ) in readReq()
1371 if ( allocateBuf( pReq, 8192 ) == -1 ) in readReq()
1375 while ( pReq->m_bufRead < LSAPI_PACKET_HEADER_LEN ) in readReq()
1377 len = lsapi_read( pReq->m_fd, pReq->m_pReqBuf, pReq->m_reqBufSize ); in readReq()
1380 pReq->m_bufRead += len; in readReq()
1382 pReq->m_reqState = LSAPI_ST_REQ_HEADER; in readReq()
1384 packetLen = verifyHeader( &pReq->m_pHeader->m_pktHeader, LSAPI_BEGIN_REQUEST ); in readReq()
1396 if ( packetLen + 1024 > pReq->m_reqBufSize ) in readReq()
1398 if ( allocateBuf( pReq, packetLen + 1024 ) == -1 ) in readReq()
1401 while( packetLen > pReq->m_bufRead ) in readReq()
1403 … len = lsapi_read( pReq->m_fd, pReq->m_pReqBuf + pReq->m_bufRead, packetLen - pReq->m_bufRead ); in readReq()
1406 pReq->m_bufRead += len; in readReq()
1408 if ( parseRequest( pReq, packetLen ) < 0 ) in readReq()
1414 pReq->m_reqState = LSAPI_ST_REQ_BODY | LSAPI_ST_RESP_HEADER; in readReq()
1418 if ( lsapi_changeUGid( pReq ) ) in readReq()
1422 pReq->m_bufProcessed = packetLen; in readReq()
1426 return notify_req_received( pReq->m_fd ); in readReq()
1481 int LSAPI_InitRequest( LSAPI_Request * pReq, int fd ) in LSAPI_InitRequest() argument
1484 if ( !pReq ) in LSAPI_InitRequest()
1486 memset( pReq, 0, sizeof( LSAPI_Request ) ); in LSAPI_InitRequest()
1487 if ( allocateIovec( pReq, 16 ) == -1 ) in LSAPI_InitRequest()
1489 pReq->m_pRespBuf = pReq->m_pRespBufPos = (char *)malloc( LSAPI_RESP_BUF_SIZE ); in LSAPI_InitRequest()
1490 if ( !pReq->m_pRespBuf ) in LSAPI_InitRequest()
1492 pReq->m_pRespBufEnd = pReq->m_pRespBuf + LSAPI_RESP_BUF_SIZE; in LSAPI_InitRequest()
1493 pReq->m_pIovecCur = pReq->m_pIovecToWrite = pReq->m_pIovec + 1; in LSAPI_InitRequest()
1494 pReq->m_respPktHeaderEnd = &pReq->m_respPktHeader[5]; in LSAPI_InitRequest()
1495 if ( allocateRespHeaderBuf( pReq, LSAPI_INIT_RESP_HEADER_LEN ) == -1 ) in LSAPI_InitRequest()
1507 pReq->m_fdListen = -1; in LSAPI_InitRequest()
1508 pReq->m_fd = fd; in LSAPI_InitRequest()
1512 pReq->m_fdListen = fd; in LSAPI_InitRequest()
1513 pReq->m_fd = -1; in LSAPI_InitRequest()
1526 int LSAPI_Is_Listen_r( LSAPI_Request * pReq) in LSAPI_Is_Listen_r() argument
1528 return pReq->m_fdListen != -1; in LSAPI_Is_Listen_r()
1532 int LSAPI_Accept_r( LSAPI_Request * pReq ) in LSAPI_Accept_r() argument
1538 if ( !pReq ) in LSAPI_Accept_r()
1540 if ( LSAPI_Finish_r( pReq ) == -1 ) in LSAPI_Accept_r()
1542 lsapi_set_nblock( pReq->m_fdListen , 0 ); in LSAPI_Accept_r()
1545 if ( pReq->m_fd == -1 ) in LSAPI_Accept_r()
1547 if ( pReq->m_fdListen != -1) in LSAPI_Accept_r()
1550 pReq->m_fd = accept( pReq->m_fdListen, in LSAPI_Accept_r()
1552 if ( pReq->m_fd == -1 ) in LSAPI_Accept_r()
1566 lsapi_set_nblock( pReq->m_fd , 0 ); in LSAPI_Accept_r()
1569 setsockopt(pReq->m_fd, IPPROTO_TCP, TCP_NODELAY, in LSAPI_Accept_r()
1575 if ( notify_req_received( pReq->m_fd ) == -1 ) in LSAPI_Accept_r()
1582 if ( !readReq( pReq ) ) in LSAPI_Accept_r()
1585 lsapi_close_connection(pReq); in LSAPI_Accept_r()
1586 LSAPI_Reset_r( pReq ); in LSAPI_Accept_r()
1599 int LSAPI_Finish_r( LSAPI_Request * pReq ) in LSAPI_Finish_r() argument
1602 if ( !pReq ) in LSAPI_Finish_r()
1604 if (pReq->m_reqState) in LSAPI_Finish_r()
1606 if ( pReq->m_fd != -1 ) in LSAPI_Finish_r()
1608 if ( pReq->m_reqState & LSAPI_ST_RESP_HEADER ) in LSAPI_Finish_r()
1610 LSAPI_FinalizeRespHeaders_r( pReq ); in LSAPI_Finish_r()
1612 if ( pReq->m_pRespBufPos != pReq->m_pRespBuf ) in LSAPI_Finish_r()
1614 Flush_RespBuf_r( pReq ); in LSAPI_Finish_r()
1617 pReq->m_pIovecCur->iov_base = (void *)finish_close; in LSAPI_Finish_r()
1618 pReq->m_pIovecCur->iov_len = LSAPI_PACKET_HEADER_LEN; in LSAPI_Finish_r()
1619 pReq->m_totalLen += LSAPI_PACKET_HEADER_LEN; in LSAPI_Finish_r()
1620 ++pReq->m_pIovecCur; in LSAPI_Finish_r()
1621 LSAPI_Flush_r( pReq ); in LSAPI_Finish_r()
1623 LSAPI_Reset_r( pReq ); in LSAPI_Finish_r()
1629 int LSAPI_End_Response_r(LSAPI_Request * pReq) in LSAPI_End_Response_r() argument
1631 if (!pReq) in LSAPI_End_Response_r()
1633 if (pReq->m_reqState & LSAPI_ST_BACKGROUND) in LSAPI_End_Response_r()
1635 if (pReq->m_reqState) in LSAPI_End_Response_r()
1637 if ( pReq->m_fd != -1 ) in LSAPI_End_Response_r()
1639 if ( pReq->m_reqState & LSAPI_ST_RESP_HEADER ) in LSAPI_End_Response_r()
1641 if ( pReq->m_pRespHeaderBufPos <= pReq->m_pRespHeaderBuf ) in LSAPI_End_Response_r()
1644 LSAPI_FinalizeRespHeaders_r( pReq ); in LSAPI_End_Response_r()
1646 if ( pReq->m_pRespBufPos != pReq->m_pRespBuf ) in LSAPI_End_Response_r()
1648 Flush_RespBuf_r( pReq ); in LSAPI_End_Response_r()
1651 pReq->m_pIovecCur->iov_base = (void *)finish_close; in LSAPI_End_Response_r()
1652 pReq->m_pIovecCur->iov_len = LSAPI_PACKET_HEADER_LEN << 1; in LSAPI_End_Response_r()
1653 pReq->m_totalLen += LSAPI_PACKET_HEADER_LEN << 1; in LSAPI_End_Response_r()
1654 ++pReq->m_pIovecCur; in LSAPI_End_Response_r()
1655 LSAPI_Flush_r( pReq ); in LSAPI_End_Response_r()
1656 lsapi_close_connection(pReq); in LSAPI_End_Response_r()
1658 pReq->m_reqState |= LSAPI_ST_BACKGROUND; in LSAPI_End_Response_r()
1664 void LSAPI_Reset_r( LSAPI_Request * pReq ) in LSAPI_Reset_r() argument
1666 pReq->m_pRespBufPos = pReq->m_pRespBuf; in LSAPI_Reset_r()
1667 pReq->m_pIovecCur = pReq->m_pIovecToWrite = pReq->m_pIovec + 1; in LSAPI_Reset_r()
1668 pReq->m_pRespHeaderBufPos = pReq->m_pRespHeaderBuf; in LSAPI_Reset_r()
1670 memset( &pReq->m_pHeaderIndex, 0, in LSAPI_Reset_r()
1671 (char *)(pReq->m_respHeaderLen) - (char *)&pReq->m_pHeaderIndex ); in LSAPI_Reset_r()
1675 int LSAPI_Release_r( LSAPI_Request * pReq ) in LSAPI_Release_r() argument
1677 if ( pReq->m_pReqBuf ) in LSAPI_Release_r()
1678 free( pReq->m_pReqBuf ); in LSAPI_Release_r()
1679 if ( pReq->m_pSpecialEnvList ) in LSAPI_Release_r()
1680 free( pReq->m_pSpecialEnvList ); in LSAPI_Release_r()
1681 if ( pReq->m_pEnvList ) in LSAPI_Release_r()
1682 free( pReq->m_pEnvList ); in LSAPI_Release_r()
1683 if ( pReq->m_pRespHeaderBuf ) in LSAPI_Release_r()
1684 free( pReq->m_pRespHeaderBuf ); in LSAPI_Release_r()
1689 char * LSAPI_GetHeader_r( LSAPI_Request * pReq, int headerIndex ) in LSAPI_GetHeader_r() argument
1692 if ( !pReq || ((unsigned int)headerIndex > H_TRANSFER_ENCODING) ) in LSAPI_GetHeader_r()
1694 off = pReq->m_pHeaderIndex->m_headerOff[ headerIndex ]; in LSAPI_GetHeader_r()
1697 if ( *(pReq->m_pHttpHeader + off in LSAPI_GetHeader_r()
1698 + pReq->m_pHeaderIndex->m_headerLen[ headerIndex ]) ) in LSAPI_GetHeader_r()
1700 *( pReq->m_pHttpHeader + off in LSAPI_GetHeader_r()
1701 + pReq->m_pHeaderIndex->m_headerLen[ headerIndex ]) = 0; in LSAPI_GetHeader_r()
1703 return pReq->m_pHttpHeader + off; in LSAPI_GetHeader_r()
1707 static int readBodyToReqBuf( LSAPI_Request * pReq ) in readBodyToReqBuf() argument
1710 ssize_t len = pReq->m_bufRead - pReq->m_bufProcessed; in readBodyToReqBuf()
1713 pReq->m_bufRead = pReq->m_bufProcessed = pReq->m_pHeader->m_pktHeader.m_packetLen.m_iLen; in readBodyToReqBuf()
1715 bodyLeft = pReq->m_reqBodyLen - pReq->m_reqBodyRead; in readBodyToReqBuf()
1716 len = pReq->m_reqBufSize - pReq->m_bufRead; in readBodyToReqBuf()
1722 len = lsapi_read( pReq->m_fd, pReq->m_pReqBuf + pReq->m_bufRead, len ); in readBodyToReqBuf()
1724 pReq->m_bufRead += len; in readBodyToReqBuf()
1729 int LSAPI_ReqBodyGetChar_r( LSAPI_Request * pReq ) in LSAPI_ReqBodyGetChar_r() argument
1731 if (!pReq || (pReq->m_fd ==-1) ) in LSAPI_ReqBodyGetChar_r()
1733 if ( pReq->m_bufProcessed >= pReq->m_bufRead ) in LSAPI_ReqBodyGetChar_r()
1735 if ( readBodyToReqBuf( pReq ) <= 0 ) in LSAPI_ReqBodyGetChar_r()
1738 ++pReq->m_reqBodyRead; in LSAPI_ReqBodyGetChar_r()
1739 return (unsigned char)*(pReq->m_pReqBuf + pReq->m_bufProcessed++); in LSAPI_ReqBodyGetChar_r()
1743 int LSAPI_ReqBodyGetLine_r( LSAPI_Request * pReq, char * pBuf, size_t bufLen, int *getLF ) in LSAPI_ReqBodyGetLine_r() argument
1751 if (!pReq || pReq->m_fd == -1 || !pBuf || !getLF) in LSAPI_ReqBodyGetLine_r()
1757 len = pReq->m_bufRead - pReq->m_bufProcessed; in LSAPI_ReqBodyGetLine_r()
1760 if ( (len = readBodyToReqBuf( pReq )) <= 0 ) in LSAPI_ReqBodyGetLine_r()
1768 pCur = pReq->m_pReqBuf + pReq->m_bufProcessed; in LSAPI_ReqBodyGetLine_r()
1774 pReq->m_bufProcessed += len; in LSAPI_ReqBodyGetLine_r()
1776 pReq->m_reqBodyRead += len; in LSAPI_ReqBodyGetLine_r()
1790 ssize_t LSAPI_ReadReqBody_r( LSAPI_Request * pReq, char * pBuf, size_t bufLen ) in LSAPI_ReadReqBody_r() argument
1795 if (!pReq || pReq->m_fd == -1 || !pBuf || (ssize_t)bufLen < 0) in LSAPI_ReadReqBody_r()
1798 total = pReq->m_reqBodyLen - pReq->m_reqBodyRead; in LSAPI_ReadReqBody_r()
1806 len = pReq->m_bufRead - pReq->m_bufProcessed; in LSAPI_ReadReqBody_r()
1811 memmove( pBuf, pReq->m_pReqBuf + pReq->m_bufProcessed, len ); in LSAPI_ReadReqBody_r()
1812 pReq->m_bufProcessed += len; in LSAPI_ReadReqBody_r()
1819 len = lsapi_read( pReq->m_fd, pBuf, bufLen ); in LSAPI_ReadReqBody_r()
1833 pReq->m_reqBodyRead += total; in LSAPI_ReadReqBody_r()
1839 ssize_t LSAPI_Write_r( LSAPI_Request * pReq, const char * pBuf, size_t len ) in LSAPI_Write_r() argument
1849 if (!pReq || !pBuf) in LSAPI_Write_r()
1851 if (pReq->m_reqState & LSAPI_ST_BACKGROUND) in LSAPI_Write_r()
1853 if (pReq->m_fd == -1) in LSAPI_Write_r()
1855 if ( pReq->m_reqState & LSAPI_ST_RESP_HEADER ) in LSAPI_Write_r()
1857 LSAPI_FinalizeRespHeaders_r( pReq ); in LSAPI_Write_r()
1869 pReq->m_reqState |= LSAPI_ST_RESP_BODY; in LSAPI_Write_r()
1871 if ( ((ssize_t)len - skip) < pReq->m_pRespBufEnd - pReq->m_pRespBufPos ) in LSAPI_Write_r()
1873 memmove( pReq->m_pRespBufPos, pBuf + skip, len - skip ); in LSAPI_Write_r()
1874 pReq->m_pRespBufPos += len - skip; in LSAPI_Write_r()
1879 pHeader = pReq->m_respPktHeader; in LSAPI_Write_r()
1882 bufLen = pReq->m_pRespBufPos - pReq->m_pRespBuf; in LSAPI_Write_r()
1895 pReq->m_totalLen += packetLen + LSAPI_PACKET_HEADER_LEN; in LSAPI_Write_r()
1897 pReq->m_pIovecCur->iov_base = (void *)pHeader; in LSAPI_Write_r()
1898 pReq->m_pIovecCur->iov_len = LSAPI_PACKET_HEADER_LEN; in LSAPI_Write_r()
1899 ++pReq->m_pIovecCur; in LSAPI_Write_r()
1903 pReq->m_pIovecCur->iov_base = (void *)pReq->m_pRespBuf; in LSAPI_Write_r()
1904 pReq->m_pIovecCur->iov_len = bufLen; in LSAPI_Write_r()
1905 pReq->m_pRespBufPos = pReq->m_pRespBuf; in LSAPI_Write_r()
1906 ++pReq->m_pIovecCur; in LSAPI_Write_r()
1910 pReq->m_pIovecCur->iov_base = (void *)p; in LSAPI_Write_r()
1911 pReq->m_pIovecCur->iov_len = toWrite; in LSAPI_Write_r()
1912 ++pReq->m_pIovecCur; in LSAPI_Write_r()
1915 if ( pHeader >= pReq->m_respPktHeaderEnd - 1) in LSAPI_Write_r()
1917 if ( LSAPI_Flush_r( pReq ) == -1 ) in LSAPI_Write_r()
1919 pHeader = pReq->m_respPktHeader; in LSAPI_Write_r()
1922 if ( pHeader != pReq->m_respPktHeader ) in LSAPI_Write_r()
1923 if ( LSAPI_Flush_r( pReq ) == -1 ) in LSAPI_Write_r()
2034 ssize_t LSAPI_sendfile_r( LSAPI_Request * pReq, int fdIn, off_t* off, size_t size ) in LSAPI_sendfile_r() argument
2036 struct lsapi_packet_header * pHeader = pReq->m_respPktHeader; in LSAPI_sendfile_r()
2037 if ( !pReq || (pReq->m_fd == -1) || fdIn == -1 ) in LSAPI_sendfile_r()
2039 if ( pReq->m_reqState & LSAPI_ST_RESP_HEADER ) in LSAPI_sendfile_r()
2041 LSAPI_FinalizeRespHeaders_r( pReq ); in LSAPI_sendfile_r()
2043 pReq->m_reqState |= LSAPI_ST_RESP_BODY; in LSAPI_sendfile_r()
2045 LSAPI_Flush_r(pReq); in LSAPI_sendfile_r()
2051 …if (write(pReq->m_fd, (const char *) pHeader, LSAPI_PACKET_HEADER_LEN ) != LSAPI_PACKET_HEADER_LE… in LSAPI_sendfile_r()
2054 return gsendfile( pReq->m_fd, fdIn, off, size ); in LSAPI_sendfile_r()
2058 void Flush_RespBuf_r( LSAPI_Request * pReq ) in Flush_RespBuf_r() argument
2060 struct lsapi_packet_header * pHeader = pReq->m_respPktHeader; in Flush_RespBuf_r()
2061 int bufLen = pReq->m_pRespBufPos - pReq->m_pRespBuf; in Flush_RespBuf_r()
2062 pReq->m_reqState |= LSAPI_ST_RESP_BODY; in Flush_RespBuf_r()
2065 pReq->m_totalLen += bufLen + LSAPI_PACKET_HEADER_LEN; in Flush_RespBuf_r()
2067 pReq->m_pIovecCur->iov_base = (void *)pHeader; in Flush_RespBuf_r()
2068 pReq->m_pIovecCur->iov_len = LSAPI_PACKET_HEADER_LEN; in Flush_RespBuf_r()
2069 ++pReq->m_pIovecCur; in Flush_RespBuf_r()
2073 pReq->m_pIovecCur->iov_base = (void *)pReq->m_pRespBuf; in Flush_RespBuf_r()
2074 pReq->m_pIovecCur->iov_len = bufLen; in Flush_RespBuf_r()
2075 pReq->m_pRespBufPos = pReq->m_pRespBuf; in Flush_RespBuf_r()
2076 ++pReq->m_pIovecCur; in Flush_RespBuf_r()
2082 int LSAPI_Flush_r( LSAPI_Request * pReq ) in LSAPI_Flush_r() argument
2086 if ( !pReq ) in LSAPI_Flush_r()
2088 n = pReq->m_pIovecCur - pReq->m_pIovecToWrite; in LSAPI_Flush_r()
2089 if (( 0 == n )&&( pReq->m_pRespBufPos == pReq->m_pRespBuf )) in LSAPI_Flush_r()
2091 if ( pReq->m_fd == -1 ) in LSAPI_Flush_r()
2093 pReq->m_pRespBufPos = pReq->m_pRespBuf; in LSAPI_Flush_r()
2094 pReq->m_totalLen = 0; in LSAPI_Flush_r()
2095 pReq->m_pIovecCur = pReq->m_pIovecToWrite = pReq->m_pIovec; in LSAPI_Flush_r()
2098 if ( pReq->m_reqState & LSAPI_ST_RESP_HEADER ) in LSAPI_Flush_r()
2100 LSAPI_FinalizeRespHeaders_r( pReq ); in LSAPI_Flush_r()
2102 if ( pReq->m_pRespBufPos != pReq->m_pRespBuf ) in LSAPI_Flush_r()
2104 Flush_RespBuf_r( pReq ); in LSAPI_Flush_r()
2107 n = pReq->m_pIovecCur - pReq->m_pIovecToWrite; in LSAPI_Flush_r()
2111 ret = lsapi_writev( pReq->m_fd, &pReq->m_pIovecToWrite, in LSAPI_Flush_r()
2112 n, pReq->m_totalLen ); in LSAPI_Flush_r()
2113 if ( ret < pReq->m_totalLen ) in LSAPI_Flush_r()
2115 lsapi_close_connection(pReq); in LSAPI_Flush_r()
2118 pReq->m_totalLen = 0; in LSAPI_Flush_r()
2119 pReq->m_pIovecCur = pReq->m_pIovecToWrite = pReq->m_pIovec; in LSAPI_Flush_r()
2125 ssize_t LSAPI_Write_Stderr_r( LSAPI_Request * pReq, const char * pBuf, size_t len ) in LSAPI_Write_Stderr_r() argument
2136 if ( !pReq ) in LSAPI_Write_Stderr_r()
2138 if (s_stderr_log_path || pReq->m_fd == -1 || pReq->m_fd == pReq->m_fdListen) in LSAPI_Write_Stderr_r()
2140 if ( pReq->m_pRespBufPos != pReq->m_pRespBuf ) in LSAPI_Write_Stderr_r()
2142 LSAPI_Flush_r( pReq ); in LSAPI_Write_Stderr_r()
2166 ret = lsapi_writev( pReq->m_fd, &pIov, in LSAPI_Write_Stderr_r()
2170 lsapi_close_connection(pReq); in LSAPI_Write_Stderr_r()
2178 static char * GetHeaderVar( LSAPI_Request * pReq, const char * name ) in GetHeaderVar() argument
2184 if ( pReq->m_pHeaderIndex->m_headerOff[i] ) in GetHeaderVar()
2188 pValue = pReq->m_pHttpHeader in GetHeaderVar()
2189 + pReq->m_pHeaderIndex->m_headerOff[i]; in GetHeaderVar()
2190 if ( *(pValue + pReq->m_pHeaderIndex->m_headerLen[i]) != '\0') in GetHeaderVar()
2192 *(pValue + pReq->m_pHeaderIndex->m_headerLen[i]) = '\0'; in GetHeaderVar()
2198 if ( pReq->m_pHeader->m_cntUnknownHeaders > 0 ) in GetHeaderVar()
2205 pCur = pReq->m_pUnknownHeader; in GetHeaderVar()
2206 pEnd = pCur + pReq->m_pHeader->m_cntUnknownHeaders; in GetHeaderVar()
2209 pKey = pReq->m_pHttpHeader + pCur->nameOff; in GetHeaderVar()
2223 pValue = pReq->m_pHttpHeader + pCur->valueOff; in GetHeaderVar()
2238 char * LSAPI_GetEnv_r( LSAPI_Request * pReq, const char * name ) in LSAPI_GetEnv_r() argument
2240 struct LSAPI_key_value_pair * pBegin = pReq->m_pEnvList; in LSAPI_GetEnv_r()
2241 struct LSAPI_key_value_pair * pEnd = pBegin + pReq->m_pHeader->m_cntEnv; in LSAPI_GetEnv_r()
2242 if ( !pReq || !name ) in LSAPI_GetEnv_r()
2246 return GetHeaderVar( pReq, name ); in LSAPI_GetEnv_r()
2274 int LSAPI_ForeachOrgHeader_r( LSAPI_Request * pReq, in LSAPI_ForeachOrgHeader_r() argument
2284 if ( !pReq || !fn ) in LSAPI_ForeachOrgHeader_r()
2287 if ( !pReq->m_pHeaderIndex ) in LSAPI_ForeachOrgHeader_r()
2292 if ( pReq->m_pHeaderIndex->m_headerOff[i] ) in LSAPI_ForeachOrgHeader_r()
2294 len = pReq->m_pHeaderIndex->m_headerLen[i]; in LSAPI_ForeachOrgHeader_r()
2295 pValue = pReq->m_pHttpHeader + pReq->m_pHeaderIndex->m_headerOff[i]; in LSAPI_ForeachOrgHeader_r()
2309 if ( pReq->m_pHeader->m_cntUnknownHeaders > 0 ) in LSAPI_ForeachOrgHeader_r()
2314 pCur = pReq->m_pUnknownHeader; in LSAPI_ForeachOrgHeader_r()
2315 pEnd = pCur + pReq->m_pHeader->m_cntUnknownHeaders; in LSAPI_ForeachOrgHeader_r()
2318 pKey = pReq->m_pHttpHeader + pCur->nameOff; in LSAPI_ForeachOrgHeader_r()
2322 pValue = pReq->m_pHttpHeader + pCur->valueOff; in LSAPI_ForeachOrgHeader_r()
2350 int LSAPI_ForeachHeader_r( LSAPI_Request * pReq, in LSAPI_ForeachHeader_r() argument
2358 if ( !pReq || !fn ) in LSAPI_ForeachHeader_r()
2362 if ( pReq->m_pHeaderIndex->m_headerOff[i] ) in LSAPI_ForeachHeader_r()
2364 len = pReq->m_pHeaderIndex->m_headerLen[i]; in LSAPI_ForeachHeader_r()
2365 pValue = pReq->m_pHttpHeader + pReq->m_pHeaderIndex->m_headerOff[i]; in LSAPI_ForeachHeader_r()
2374 if ( pReq->m_pHeader->m_cntUnknownHeaders > 0 ) in LSAPI_ForeachHeader_r()
2382 pCur = pReq->m_pUnknownHeader; in LSAPI_ForeachHeader_r()
2383 pEnd = pCur + pReq->m_pHeader->m_cntUnknownHeaders; in LSAPI_ForeachHeader_r()
2386 pKey = pReq->m_pHttpHeader + pCur->nameOff; in LSAPI_ForeachHeader_r()
2405 pValue = pReq->m_pHttpHeader + pCur->valueOff; in LSAPI_ForeachHeader_r()
2414 return count + pReq->m_pHeader->m_cntUnknownHeaders; in LSAPI_ForeachHeader_r()
2437 int LSAPI_ForeachEnv_r( LSAPI_Request * pReq, in LSAPI_ForeachEnv_r() argument
2440 if ( !pReq || !fn ) in LSAPI_ForeachEnv_r()
2442 if ( pReq->m_pHeader->m_cntEnv > 0 ) in LSAPI_ForeachEnv_r()
2444 return EnvForeach( pReq->m_pEnvList, pReq->m_pHeader->m_cntEnv, in LSAPI_ForeachEnv_r()
2451 int LSAPI_ForeachSpecialEnv_r( LSAPI_Request * pReq, in LSAPI_ForeachSpecialEnv_r() argument
2454 if ( !pReq || !fn ) in LSAPI_ForeachSpecialEnv_r()
2456 if ( pReq->m_pHeader->m_cntSpecialEnv > 0 ) in LSAPI_ForeachSpecialEnv_r()
2458 return EnvForeach( pReq->m_pSpecialEnvList, in LSAPI_ForeachSpecialEnv_r()
2459 pReq->m_pHeader->m_cntSpecialEnv, in LSAPI_ForeachSpecialEnv_r()
2467 int LSAPI_FinalizeRespHeaders_r( LSAPI_Request * pReq ) in LSAPI_FinalizeRespHeaders_r() argument
2469 if ( !pReq || !pReq->m_pIovec ) in LSAPI_FinalizeRespHeaders_r()
2471 if ( !( pReq->m_reqState & LSAPI_ST_RESP_HEADER ) ) in LSAPI_FinalizeRespHeaders_r()
2473 pReq->m_reqState &= ~LSAPI_ST_RESP_HEADER; in LSAPI_FinalizeRespHeaders_r()
2474 if ( pReq->m_pRespHeaderBufPos > pReq->m_pRespHeaderBuf ) in LSAPI_FinalizeRespHeaders_r()
2476 pReq->m_pIovecCur->iov_base = (void *)pReq->m_pRespHeaderBuf; in LSAPI_FinalizeRespHeaders_r()
2477 pReq->m_pIovecCur->iov_len = pReq->m_pRespHeaderBufPos - pReq->m_pRespHeaderBuf; in LSAPI_FinalizeRespHeaders_r()
2478 pReq->m_totalLen += pReq->m_pIovecCur->iov_len; in LSAPI_FinalizeRespHeaders_r()
2479 ++pReq->m_pIovecCur; in LSAPI_FinalizeRespHeaders_r()
2482 pReq->m_pIovec->iov_len = sizeof( struct lsapi_resp_header) in LSAPI_FinalizeRespHeaders_r()
2483 + pReq->m_respHeader.m_respInfo.m_cntHeaders * sizeof( short ); in LSAPI_FinalizeRespHeaders_r()
2484 pReq->m_totalLen += pReq->m_pIovec->iov_len; in LSAPI_FinalizeRespHeaders_r()
2486 lsapi_buildPacketHeader( &pReq->m_respHeader.m_pktHeader, in LSAPI_FinalizeRespHeaders_r()
2487 LSAPI_RESP_HEADER, pReq->m_totalLen ); in LSAPI_FinalizeRespHeaders_r()
2488 pReq->m_pIovec->iov_base = (void *)&pReq->m_respHeader; in LSAPI_FinalizeRespHeaders_r()
2489 pReq->m_pIovecToWrite = pReq->m_pIovec; in LSAPI_FinalizeRespHeaders_r()
2494 int LSAPI_AppendRespHeader2_r( LSAPI_Request * pReq, const char * pHeaderName, in LSAPI_AppendRespHeader2_r() argument
2498 if ( !pReq || !pHeaderName || !pHeaderValue ) in LSAPI_AppendRespHeader2_r()
2500 if ( pReq->m_reqState & LSAPI_ST_RESP_BODY ) in LSAPI_AppendRespHeader2_r()
2502 if ( pReq->m_respHeader.m_respInfo.m_cntHeaders >= LSAPI_MAX_RESP_HEADERS ) in LSAPI_AppendRespHeader2_r()
2530 if ( pReq->m_pRespHeaderBufPos + len + 1 > pReq->m_pRespHeaderBufEnd ) in LSAPI_AppendRespHeader2_r()
2532 int newlen = pReq->m_pRespHeaderBufPos + len + 4096 - pReq->m_pRespHeaderBuf; in LSAPI_AppendRespHeader2_r()
2534 if ( allocateRespHeaderBuf( pReq, newlen ) == -1 ) in LSAPI_AppendRespHeader2_r()
2537 memmove( pReq->m_pRespHeaderBufPos, pHeaderName, nameLen ); in LSAPI_AppendRespHeader2_r()
2538 pReq->m_pRespHeaderBufPos += nameLen; in LSAPI_AppendRespHeader2_r()
2539 *pReq->m_pRespHeaderBufPos++ = ':'; in LSAPI_AppendRespHeader2_r()
2540 memmove( pReq->m_pRespHeaderBufPos, pHeaderValue, valLen ); in LSAPI_AppendRespHeader2_r()
2541 pReq->m_pRespHeaderBufPos += valLen; in LSAPI_AppendRespHeader2_r()
2542 *pReq->m_pRespHeaderBufPos++ = 0; in LSAPI_AppendRespHeader2_r()
2544 pReq->m_respHeaderLen[pReq->m_respHeader.m_respInfo.m_cntHeaders] = len; in LSAPI_AppendRespHeader2_r()
2545 ++pReq->m_respHeader.m_respInfo.m_cntHeaders; in LSAPI_AppendRespHeader2_r()
2550 int LSAPI_AppendRespHeader_r( LSAPI_Request * pReq, const char * pBuf, int len ) in LSAPI_AppendRespHeader_r() argument
2552 if ( !pReq || !pBuf || len <= 0 || len > LSAPI_RESP_HTTP_HEADER_MAX ) in LSAPI_AppendRespHeader_r()
2554 if ( pReq->m_reqState & LSAPI_ST_RESP_BODY ) in LSAPI_AppendRespHeader_r()
2556 if ( pReq->m_respHeader.m_respInfo.m_cntHeaders >= LSAPI_MAX_RESP_HEADERS ) in LSAPI_AppendRespHeader_r()
2568 if ( pReq->m_pRespHeaderBufPos + len + 1 > pReq->m_pRespHeaderBufEnd ) in LSAPI_AppendRespHeader_r()
2570 int newlen = pReq->m_pRespHeaderBufPos + len + 4096 - pReq->m_pRespHeaderBuf; in LSAPI_AppendRespHeader_r()
2572 if ( allocateRespHeaderBuf( pReq, newlen ) == -1 ) in LSAPI_AppendRespHeader_r()
2575 memmove( pReq->m_pRespHeaderBufPos, pBuf, len ); in LSAPI_AppendRespHeader_r()
2576 pReq->m_pRespHeaderBufPos += len; in LSAPI_AppendRespHeader_r()
2577 *pReq->m_pRespHeaderBufPos++ = 0; in LSAPI_AppendRespHeader_r()
2579 pReq->m_respHeaderLen[pReq->m_respHeader.m_respInfo.m_cntHeaders] = len; in LSAPI_AppendRespHeader_r()
2580 ++pReq->m_respHeader.m_respInfo.m_cntHeaders; in LSAPI_AppendRespHeader_r()
3149 LSAPI_Request * pReq ) in lsapi_prefork_server_accept() argument
3265 pReq->m_fd = lsapi_accept( pServer->m_fd ); in lsapi_prefork_server_accept()
3266 if ( pReq->m_fd != -1 ) in lsapi_prefork_server_accept()
3300 lsapi_set_nblock( pReq->m_fd, 0 ); in lsapi_prefork_server_accept()
3306 && pReq->m_fdListen != -1 ) in lsapi_prefork_server_accept()
3308 close( pReq->m_fdListen ); in lsapi_prefork_server_accept()
3309 pReq->m_fdListen = -1; in lsapi_prefork_server_accept()
3318 lsapi_notify_pid( pReq->m_fd ); in lsapi_prefork_server_accept()
3340 close( pReq->m_fd ); in lsapi_prefork_server_accept()
3341 pReq->m_fd = -1; in lsapi_prefork_server_accept()
3367 int LSAPI_Postfork_Child(LSAPI_Request * pReq) in LSAPI_Postfork_Child() argument
3371 __atomic_store_n(&pReq->child_status->m_pid, s_pid, __ATOMIC_SEQ_CST); in LSAPI_Postfork_Child()
3372 s_worker_status = pReq->child_status; in LSAPI_Postfork_Child()
3387 lsapi_set_nblock( pReq->m_fd, 0 ); in LSAPI_Postfork_Child()
3393 && pReq->m_fdListen != -1 ) in LSAPI_Postfork_Child()
3395 close(pReq->m_fdListen); in LSAPI_Postfork_Child()
3396 pReq->m_fdListen = -1; in LSAPI_Postfork_Child()
3400 lsapi_notify_pid(pReq->m_fd); in LSAPI_Postfork_Child()
3408 int LSAPI_Postfork_Parent(LSAPI_Request * pReq) in LSAPI_Postfork_Parent() argument
3411 if (pReq->child_status) in LSAPI_Postfork_Parent()
3414 pReq->child_status->m_tmWaitBegin = curTime; in LSAPI_Postfork_Parent()
3415 pReq->child_status->m_tmStart = curTime; in LSAPI_Postfork_Parent()
3417 close(pReq->m_fd); in LSAPI_Postfork_Parent()
3418 pReq->m_fd = -1; in LSAPI_Postfork_Parent()
3423 int LSAPI_Accept_Before_Fork(LSAPI_Request * pReq) in LSAPI_Accept_Before_Fork() argument
3460 pReq->m_reqState = 0; in LSAPI_Accept_Before_Fork()
3538 pReq->m_fd = lsapi_accept(pServer->m_fd); in LSAPI_Accept_Before_Fork()
3539 if (pReq->m_fd != -1) in LSAPI_Accept_Before_Fork()
3542 pReq->child_status = find_child_status(0); in LSAPI_Accept_Before_Fork()
3567 int LSAPI_Prefork_Accept_r( LSAPI_Request * pReq ) in LSAPI_Prefork_Accept_r() argument
3578 LSAPI_Finish_r( pReq ); in LSAPI_Prefork_Accept_r()
3583 if ( lsapi_prefork_server_accept( g_prefork_server, pReq ) == -1 ) in LSAPI_Prefork_Accept_r()
3591 send_conn_close_notification(pReq->m_fd); in LSAPI_Prefork_Accept_r()
3592 lsapi_close_connection(pReq); in LSAPI_Prefork_Accept_r()
3607 if ( pReq->m_fd != -1 ) in LSAPI_Prefork_Accept_r()
3609 fd = pReq->m_fd; in LSAPI_Prefork_Accept_r()
3611 else if ( pReq->m_fdListen != -1 ) in LSAPI_Prefork_Accept_r()
3612 fd = pReq->m_fdListen; in LSAPI_Prefork_Accept_r()
3629 if (fd == pReq->m_fdListen) in LSAPI_Prefork_Accept_r()
3638 if (fd == pReq->m_fdListen) in LSAPI_Prefork_Accept_r()
3652 if (fd == pReq->m_fdListen) in LSAPI_Prefork_Accept_r()
3686 if ( fd == pReq->m_fdListen ) in LSAPI_Prefork_Accept_r()
3688 pReq->m_fd = lsapi_accept( pReq->m_fdListen ); in LSAPI_Prefork_Accept_r()
3689 if ( pReq->m_fd != -1 ) in LSAPI_Prefork_Accept_r()
3698 fd = pReq->m_fd; in LSAPI_Prefork_Accept_r()
3704 close( pReq->m_fdListen ); in LSAPI_Prefork_Accept_r()
3705 pReq->m_fdListen = -1; in LSAPI_Prefork_Accept_r()
3708 if ( notify_req_received( pReq->m_fd ) == -1 ) in LSAPI_Prefork_Accept_r()
3724 if ( !readReq( pReq ) ) in LSAPI_Prefork_Accept_r()
3737 lsapi_close_connection(pReq); in LSAPI_Prefork_Accept_r()
3738 LSAPI_Reset_r( pReq ); in LSAPI_Prefork_Accept_r()
4108 int LSAPI_ErrResponse_r( LSAPI_Request * pReq, int code, const char ** pRespHeaders, in LSAPI_ErrResponse_r() argument
4111 LSAPI_SetRespStatus_r( pReq, code ); in LSAPI_ErrResponse_r()
4116 LSAPI_AppendRespHeader_r( pReq, *pRespHeaders, strlen( *pRespHeaders ) ); in LSAPI_ErrResponse_r()
4122 LSAPI_Write_r( pReq, pBody, bodyLen ); in LSAPI_ErrResponse_r()
4124 LSAPI_Finish_r( pReq ); in LSAPI_ErrResponse_r()