| 256 | } |
| 257 | |
| 258 | void CWebSocket::SendContent(const char* szStdResponse, const void* pContent, uint32 dwContentSize) { |
| 259 | char szBuf[0x1000]; // 0x1000 is safe because it's just used for the header |
| 260 | int nLen = snprintf(szBuf, sizeof(szBuf), "HTTP/1.1 200 OK\r\n%sContent-Length: %d\r\n\r\n", szStdResponse, dwContentSize); |
| 261 | SendData(szBuf, nLen); |
| 262 | SendData(pContent, dwContentSize); |
| 263 | } |
| 264 | |
| 265 | void CWebSocket::SendHttpHeaders(const char* szType, bool use_gzip, uint32 content_len, uint64_t session_id) |
| 266 | { |