* Print special messages (those containing no type byte) to the trace output * stream. */
| 691 | * stream. |
| 692 | */ |
| 693 | void |
| 694 | pqTraceOutputNoTypeByteMessage(PGconn *conn, const char *message) |
| 695 | { |
| 696 | int length; |
| 697 | int logCursor = 0; |
| 698 | |
| 699 | if ((conn->traceFlags & PQTRACE_SUPPRESS_TIMESTAMPS) == 0) |
| 700 | { |
| 701 | char timestr[128]; |
| 702 | |
| 703 | pqTraceFormatTimestamp(timestr, sizeof(timestr)); |
| 704 | fprintf(conn->Pfdebug, "%s\t", timestr); |
| 705 | } |
| 706 | |
| 707 | memcpy(&length, message + logCursor, 4); |
| 708 | length = (int) pg_ntoh32(length); |
| 709 | logCursor += 4; |
| 710 | |
| 711 | fprintf(conn->Pfdebug, "F\t%d\t", length); |
| 712 | |
| 713 | switch (length) |
| 714 | { |
| 715 | case 16: /* CancelRequest */ |
| 716 | fprintf(conn->Pfdebug, "CancelRequest\t"); |
| 717 | pqTraceOutputInt32(conn->Pfdebug, message, &logCursor, false); |
| 718 | pqTraceOutputInt32(conn->Pfdebug, message, &logCursor, false); |
| 719 | pqTraceOutputInt32(conn->Pfdebug, message, &logCursor, false); |
| 720 | break; |
| 721 | case 8: /* GSSENCRequest or SSLRequest */ |
| 722 | /* These messages do not reach here. */ |
| 723 | default: |
| 724 | fprintf(conn->Pfdebug, "Unknown message: length is %d", length); |
| 725 | break; |
| 726 | } |
| 727 | |
| 728 | fputc('\n', conn->Pfdebug); |
| 729 | } |
no test coverage detected