|
| BA_API int | HttpTrace_setPrio (int prio) |
| | Set the trace message priority filter. More...
|
| |
| BA_API void | HttpTrace_setFLushCallback (HttpTrace_Flush fcb) |
| | The HTTP_TRACE compile time macro adds the trace library to the Barracuda library, but the trace functions will have no effect if you do not provide a callback function. More...
|
| |
| BA_API HttpTrace_Flush | HttpTrace_getFLushCallback (void) |
| |
| BA_API void | HttpTrace_vprintf (int prio, const char *fmt, va_list argList) |
| | Write data to the trace buffer. More...
|
| |
| BA_API void | HttpTrace_printf (int prio, const char *fmt,...) |
| | Write data to the trace buffer. More...
|
| |
| BA_API void | HttpTrace_write (int prio, const char *buf, int len) |
| | Write data to the trace buffer. More...
|
| |
| BA_API void | HttpTrace_flush (void) |
| | Force a flush on data in trace buffer; i.e., call the flush callback. More...
|
| |
| BA_API void | HttpTrace_setRequest (BaBool cmd) |
| | Enable or disable request-line tracing. More...
|
| |
| BA_API void | HttpTrace_setRequestHeaders (BaBool cmd) |
| | If enabled, the web-server dumps the content of the request header to the trace buffer. More...
|
| |
| BA_API void | HttpTrace_setResponseHeaders (BaBool cmd) |
| | If enabled, the web-server dumps the content of the response header to the trace buffer. More...
|
| |
| BA_API void | HttpTrace_setResponseBody (BaBool cmd) |
| | If enabled, the web-server dumps the content of the response body to the trace buffer. More...
|
| |
| BA_API void | HttpTrace_setHttp11State (BaBool cmd) |
| | If enabled, prints the status for each active client connection of the internal "HTTP 1.1 persistent connection" state machine to the trace buffer. More...
|
| |
| BA_API void | HttpTrace_setReqBufOverflow (BaBool cmd) |
| | Report when an HTTP request exceeds the configured request buffer. More...
|
| |
| BA_API int | HttpTrace_setBufSize (int size) |
| | Set trace buffer size. More...
|
| |
| BA_API void | HttpTrace_close (void) |
| | Release the trace buffer and disable output without flushing pending bytes. More...
|
| |
| BA_API BufPrint * | HttpTrace_getWriter (void) |
| | Get and lock the trace BufPrint object. More...
|
| |
| BA_API void | HttpTrace_releaseWriter (void) |
| | Release a writer lock obtained by a successful getWriter call. More...
|
| |
Buffered diagnostic output and optional HTTP protocol tracing.
Install a flush callback at startup to enable output. If the library is built without HTTP_TRACE, output functions have no effect. This header enables HTTP_TRACE by default unless NO_HTTP_TRACE is defined.
Priority zero is highest. A message is emitted when its priority is less than or equal to the configured filter (initially 5). Optional HTTP trace categories are initially disabled and use priority 5 when enabled.
Output is flushed when the buffer fills, after a write that leaves a newline in the buffer, or by an explicit flush(). Partial lines may remain buffered. The default payload buffer is approximately 80 bytes.
Configure the callback and buffer size at startup, before concurrent use. Do not change or close the trace while a writer is locked. Output functions serialize access with the trace mutex; the callback executes under that mutex and must not call back into trace output.
- See also
- HttpTrace::setFLushCallback
The HTTP_TRACE compile time macro adds the trace library to the Barracuda library, but the trace functions will have no effect if you do not provide a callback function.
This function is not re-entrant; therefore, you should call this function at system startup.
The following example dumps data to the console:
void flush2Console(char* buf, int bufLen)
{
buf[bufLen] = 0;
printf("%s",buf);
}
.
.
BA_API void HttpTrace_setFLushCallback(HttpTrace_Flush fcb)
The HTTP_TRACE compile time macro adds the trace library to the Barracuda library,...
Newline-terminated output is flushed automatically. To deliver partial lines promptly, flush explicitly, for example after a dispatcher poll.
for(;;)
{
myDispatcher->run(1000);
}
static void flush()
Force a flush on data in trace buffer; i.e., call the flush callback.
Definition: HttpTrace.h:404
- Parameters
-
| [in] | fcb | Callback retained until replaced, or NULL to disable output. Allocation failure during initialization leaves tracing disabled; HttpTrace_getFLushCallback returns NULL in that case. |
| BA_API void HttpTrace_setHttp11State |
( |
BaBool |
cmd | ) |
|
If enabled, prints the status for each active client connection of the internal "HTTP 1.1 persistent connection" state machine to the trace buffer.
The state machine can be in one of 5 states. As an example, a non-persistent connection will go through the following states for each request:
Connection 56c1f0 3944 trans: Free -> Connected
Connection 56c1f0 3944 trans: Connected -> Running
Connection 56c1f0 3944 trans: Running -> Terminated
Connection 56c1f0 -001 trans: Terminated -> Free
A persistent HTTP connection is in one of the Connected or Running states.
Connection 56c290 3944 trans: Connected -> Running
Connection 56c290 3944 trans: Running -> Connected
Connection 56c290 3944 trans: Connected -> Running
Connection 56c290 3944 trans: Running -> Connected
Connection 56c290 3944 trans: Connected -> Running
Connection 56c290 3944 trans: Running -> Connected
- Parameters
-
| [in] | cmd | TRUE enables this trace category; FALSE disables it. |