cleanup printf statements

This commit is contained in:
F. Duncanh
2024-12-13 10:32:50 -05:00
parent 2ebc2b032f
commit 45b8c0d1c2
5 changed files with 21 additions and 39 deletions

View File

@@ -343,7 +343,6 @@ int gcm_decrypt(unsigned char *ciphertext, int ciphertext_len, unsigned char *pl
return plaintext_len;
} else {
/* Verify failed */
printf("failed\n");
return -1;
}
}

View File

@@ -413,22 +413,22 @@ httpd_thread(void *arg)
logger_log(httpd->logger, LOGGER_DEBUG, "httpd receiving on socket %d, connection %d",
connection->socket_fd, i);
if (logger_debug) {
printf("\nhttpd: current connections:\n");
logger_log(httpd->logger, LOGGER_DEBUG,"\nhttpd: current connections:");
for (int i = 0; i < httpd->max_connections; i++) {
http_connection_t *connection = &httpd->connections[i];
if(!connection->connected) {
continue;
}
if (!FD_ISSET(connection->socket_fd, &rfds)) {
printf("connection %d type %d socket %d conn %p %s\n", i,
connection->type, connection->socket_fd,
connection->user_data, typename [connection->type]);
logger_log(httpd->logger, LOGGER_DEBUG, "connection %d type %d socket %d conn %p %s", i,
connection->type, connection->socket_fd,
connection->user_data, typename [connection->type]);
} else {
printf("connection %d type %d socket %d conn %p %s ACTIVE CONNECTION\n", i, connection->type,
connection->socket_fd, connection->user_data, typename [connection->type]);
logger_log(httpd->logger, LOGGER_DEBUG, "connection %d type %d socket %d conn %p %s ACTIVE CONNECTION",
i, connection->type, connection->socket_fd, connection->user_data, typename [connection->type]);
}
}
printf("\n");
logger_log(httpd->logger, LOGGER_DEBUG, " ");
}
/* reverse-http responses from the client must not be sent to the llhttp parser:
* such messages start with "HTTP/1.1" */

View File

@@ -311,19 +311,16 @@ conn_request(void *ptr, http_request_t *request, http_response_t **response) {
char * plist_xml;
uint32_t plist_len;
plist_to_xml(req_root_node, &plist_xml, &plist_len);
printf("%s\n",plist_xml);
//logger_log(conn->raop->logger, LOGGER_DEBUG, "%s", plist_xml);
logger_log(conn->raop->logger, LOGGER_DEBUG, "%s", plist_xml);
free(plist_xml);
plist_free(req_root_node);
} else if (data_is_text) {
char *data_str = utils_data_to_text((char *) request_data, request_datalen);
printf("%s\n", data_str);
//logger_log(conn->raop->logger, LOGGER_DEBUG, "%s", data_str);
logger_log(conn->raop->logger, LOGGER_DEBUG, "%s", data_str);
free(data_str);
} else {
char *data_str = utils_data_to_string((unsigned char *) request_data, request_datalen, 16);
printf("%s\n", data_str);
//logger_log(conn->raop->logger, LOGGER_DEBUG, "%s", data_str);
logger_log(conn->raop->logger, LOGGER_DEBUG, "%s", data_str);
free(data_str);
}
}
@@ -449,18 +446,15 @@ conn_request(void *ptr, http_request_t *request, http_response_t **response) {
uint32_t plist_len;
plist_to_xml(res_root_node, &plist_xml, &plist_len);
plist_free(res_root_node);
printf("%s\n", plist_xml);
//logger_log(conn->raop->logger, LOGGER_DEBUG, "%s", plist_xml);
logger_log(conn->raop->logger, LOGGER_DEBUG, "%s", plist_xml);
free(plist_xml);
} else if (data_is_text) {
char *data_str = utils_data_to_text((char*) response_data, response_datalen);
printf("%s\n", data_str);
//logger_log(conn->raop->logger, LOGGER_DEBUG, "%s", data_str);
logger_log(conn->raop->logger, LOGGER_DEBUG, "%s", data_str);
free(data_str);
} else {
char *data_str = utils_data_to_string((unsigned char *) response_data, response_datalen, 16);
printf("%s\n", data_str);
//logger_log(conn->raop->logger, LOGGER_DEBUG, "%s", data_str);
logger_log(conn->raop->logger, LOGGER_DEBUG, "%s", data_str);
free(data_str);
}
}

View File

@@ -541,9 +541,6 @@ raop_rtp_mirror_thread(void *arg)
raop_rtp_mirror->callbacks.video_process(raop_rtp_mirror->callbacks.cls, raop_rtp_mirror->ntp, &video_data);
free(payload_out);
break;
//char *str3 = utils_data_to_string(payload_out, video_data.data_len, 16);
//printf("%s\n", str3);
//free (str3);
case 0x01:
/* 128-byte observed packet header structure
bytes 0-15: length + timestamp
@@ -609,13 +606,12 @@ raop_rtp_mirror_thread(void *arg)
free(sps_pps);
sps_pps = NULL;
}
/* test for a H265 VPS/SPs/PPS */
/* test for a H265 VPS/SPS/PPS */
unsigned char hvc1[] = { 0x68, 0x76, 0x63, 0x31 };
if (!memcmp(payload + 4, hvc1, 4)) {
/* hvc1 HECV detected */
codec = VIDEO_CODEC_H265;
printf("h265 detected\n");
h265_video = true;
raop_rtp_mirror->callbacks.video_set_codec(raop_rtp_mirror->callbacks.cls, codec);
unsigned char vps_start_code[] = { 0xa0, 0x00, 0x01, 0x00 };
@@ -687,10 +683,6 @@ raop_rtp_mirror_thread(void *arg)
memcpy(ptr, nal_start_code, 4);
ptr += 4;
memcpy(ptr, pps, pps_size);
// printf (" HEVC (hvc1) vps + sps + pps NALU\n");
//char *str = utils_data_to_string(sps_pps, sps_pps_len, 16);
//printf("%s\n", str);
//free (str);
} else {
codec = VIDEO_CODEC_H264;
h265_video = false;