mirror of
https://github.com/kakwa/uts-server
synced 2025-01-08 12:44:30 +01:00
more consistent log messages
This commit is contained in:
parent
a4225b4810
commit
6df936d408
@ -256,8 +256,7 @@ end:
|
|||||||
strncpy(*serial_id, serial_hex, SERIAL_ID_SIZE);
|
strncpy(*serial_id, serial_hex, SERIAL_ID_SIZE);
|
||||||
|
|
||||||
// log the full serial as a debug message
|
// log the full serial as a debug message
|
||||||
uts_logger(ct, LOG_DEBUG,
|
uts_logger(ct, LOG_DEBUG, "Request[%s], timestamp full serial: %s",
|
||||||
"timestamp full serial: %s (response serial '%s...')",
|
|
||||||
serial_hex, *serial_id);
|
serial_hex, *serial_id);
|
||||||
|
|
||||||
free(serial_hex);
|
free(serial_hex);
|
||||||
@ -268,53 +267,47 @@ end:
|
|||||||
temp[0] = '|';
|
temp[0] = '|';
|
||||||
}
|
}
|
||||||
// log the full responce status, info and failure info
|
// log the full responce status, info and failure info
|
||||||
uts_logger(ct, LOG_DEBUG,
|
uts_logger(ct, LOG_DEBUG, "Request[%s], TimeStamp OpenSSL status: |%s",
|
||||||
"TimeStamp OpenSSL status: |%s (response serial '%s...')",
|
|
||||||
bptr->data, *serial_id);
|
bptr->data, *serial_id);
|
||||||
|
|
||||||
// emit logs according the return value
|
// emit logs according the return value
|
||||||
long status = ASN1_INTEGER_get(ts_response->status_info->status);
|
long status = ASN1_INTEGER_get(ts_response->status_info->status);
|
||||||
switch (status) {
|
switch (status) {
|
||||||
case TS_STATUS_GRANTED:
|
case TS_STATUS_GRANTED:
|
||||||
uts_logger(ct, LOG_DEBUG,
|
uts_logger(ct, LOG_DEBUG, "Request[%s], timestamp request granted",
|
||||||
"timestamp request granted (response serial '%s...')",
|
|
||||||
*serial_id);
|
*serial_id);
|
||||||
ret = 200;
|
ret = 200;
|
||||||
break;
|
break;
|
||||||
case TS_STATUS_GRANTED_WITH_MODS:
|
case TS_STATUS_GRANTED_WITH_MODS:
|
||||||
uts_logger(ct, LOG_NOTICE, "timestamp request granted with "
|
uts_logger(ct, LOG_NOTICE, "timestamp request granted with "
|
||||||
"modification (response serial '%s...')",
|
"modification",
|
||||||
*serial_id);
|
*serial_id);
|
||||||
ret = 200;
|
ret = 200;
|
||||||
break;
|
break;
|
||||||
case TS_STATUS_REJECTION:
|
case TS_STATUS_REJECTION:
|
||||||
uts_logger(ct, LOG_WARNING,
|
uts_logger(ct, LOG_WARNING, "Request[%s], timestamp request rejected",
|
||||||
"timestamp request rejected (response serial '%s...')",
|
|
||||||
*serial_id);
|
*serial_id);
|
||||||
ret = 400;
|
ret = 400;
|
||||||
break;
|
break;
|
||||||
case TS_STATUS_WAITING:
|
case TS_STATUS_WAITING:
|
||||||
uts_logger(ct, LOG_NOTICE,
|
uts_logger(ct, LOG_NOTICE, "Request[%s], timestamp request waiting",
|
||||||
"timestamp request waiting (response serial '%s...')",
|
|
||||||
*serial_id);
|
*serial_id);
|
||||||
ret = 400;
|
ret = 400;
|
||||||
break;
|
break;
|
||||||
case TS_STATUS_REVOCATION_WARNING:
|
case TS_STATUS_REVOCATION_WARNING:
|
||||||
uts_logger(
|
uts_logger(ct, LOG_WARNING,
|
||||||
ct, LOG_WARNING,
|
"Request[%s], timestamp request revocation warning",
|
||||||
"timestamp request revocation warning (response serial '%s...')",
|
*serial_id);
|
||||||
*serial_id);
|
|
||||||
ret = 200;
|
ret = 200;
|
||||||
break;
|
break;
|
||||||
case TS_STATUS_REVOCATION_NOTIFICATION:
|
case TS_STATUS_REVOCATION_NOTIFICATION:
|
||||||
uts_logger(ct, LOG_NOTICE, "timestamp request revovation notification "
|
uts_logger(ct, LOG_NOTICE,
|
||||||
"(response serial '%s...')",
|
"Request[%s], timestamp request revovation notification",
|
||||||
*serial_id);
|
*serial_id);
|
||||||
ret = 500;
|
ret = 500;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
uts_logger(ct, LOG_ERR,
|
uts_logger(ct, LOG_ERR, "Request[%s], unknown error code '%d'", status,
|
||||||
"unknown error code '%d' (response serial '%s...')", status,
|
|
||||||
*serial_id);
|
*serial_id);
|
||||||
ret = 500;
|
ret = 500;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user