mirror of
https://github.com/owntone/owntone-server.git
synced 2025-02-03 01:46:02 -05:00
Tune down logging a bit more
This commit is contained in:
parent
208ef6b1f2
commit
a921916f30
@ -145,10 +145,9 @@ uint64_t scan_aac_findatom(IOHANDLE hfile, uint64_t max_offset,
|
|||||||
char atom[4];
|
char atom[4];
|
||||||
uint32_t bytes_read;
|
uint32_t bytes_read;
|
||||||
|
|
||||||
while(current_offset < max_offset) {
|
while((current_offset + 8) < max_offset) {
|
||||||
bytes_read = sizeof(uint32_t);
|
bytes_read = sizeof(uint32_t);
|
||||||
if(!io_read(hfile,(unsigned char *)&size,&bytes_read) || (!bytes_read)) {
|
if(!io_read(hfile,(unsigned char *)&size,&bytes_read) || (!bytes_read)) {
|
||||||
DPRINTF(E_LOG,L_SCAN,"Error parsing file: %s\n",io_errstr(hfile));
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -162,7 +161,6 @@ uint64_t scan_aac_findatom(IOHANDLE hfile, uint64_t max_offset,
|
|||||||
|
|
||||||
bytes_read = 4;
|
bytes_read = 4;
|
||||||
if(!io_read(hfile,(unsigned char *)atom,&bytes_read) || (!bytes_read)) {
|
if(!io_read(hfile,(unsigned char *)atom,&bytes_read) || (!bytes_read)) {
|
||||||
DPRINTF(E_LOG,L_SCAN,"Error parsing file: %s\n",io_errstr(hfile));
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -284,7 +284,7 @@ int wma_parse_header_extension(IOHANDLE hfile, int size, MP3FILE *pmp3);
|
|||||||
*/
|
*/
|
||||||
int wma_file_read_short(IOHANDLE hfile, unsigned short int *psi) {
|
int wma_file_read_short(IOHANDLE hfile, unsigned short int *psi) {
|
||||||
uint32_t len;
|
uint32_t len;
|
||||||
|
|
||||||
len = sizeof(unsigned short int);
|
len = sizeof(unsigned short int);
|
||||||
if(!io_read(hfile,(unsigned char*)psi,&len) || (len != sizeof(unsigned short int))) {
|
if(!io_read(hfile,(unsigned char*)psi,&len) || (len != sizeof(unsigned short int))) {
|
||||||
return 0;
|
return 0;
|
||||||
@ -299,7 +299,7 @@ int wma_file_read_short(IOHANDLE hfile, unsigned short int *psi) {
|
|||||||
*/
|
*/
|
||||||
int wma_file_read_int(IOHANDLE hfile, unsigned int *pi) {
|
int wma_file_read_int(IOHANDLE hfile, unsigned int *pi) {
|
||||||
uint32_t len;
|
uint32_t len;
|
||||||
|
|
||||||
len = sizeof(unsigned int);
|
len = sizeof(unsigned int);
|
||||||
if(!io_read(hfile,(unsigned char*)pi,&len) || (len != sizeof(unsigned int))) {
|
if(!io_read(hfile,(unsigned char*)pi,&len) || (len != sizeof(unsigned int))) {
|
||||||
return 0;
|
return 0;
|
||||||
@ -314,7 +314,7 @@ int wma_file_read_int(IOHANDLE hfile, unsigned int *pi) {
|
|||||||
*/
|
*/
|
||||||
int wma_file_read_ll(IOHANDLE hfile, unsigned long long *pll) {
|
int wma_file_read_ll(IOHANDLE hfile, unsigned long long *pll) {
|
||||||
uint32_t len;
|
uint32_t len;
|
||||||
|
|
||||||
len = sizeof(unsigned long long);
|
len = sizeof(unsigned long long);
|
||||||
if(!io_read(hfile,(unsigned char *)pll,&len) || (len != sizeof(unsigned long long))) {
|
if(!io_read(hfile,(unsigned char *)pll,&len) || (len != sizeof(unsigned long long))) {
|
||||||
return 0;
|
return 0;
|
||||||
@ -349,11 +349,11 @@ int wma_file_read_utf16(IOHANDLE hfile, int len, char **utf8) {
|
|||||||
|
|
||||||
int wma_file_read_bytes(IOHANDLE hfile,int len, unsigned char **data) {
|
int wma_file_read_bytes(IOHANDLE hfile,int len, unsigned char **data) {
|
||||||
uint32_t rlen;
|
uint32_t rlen;
|
||||||
|
|
||||||
*data = (unsigned char *)malloc(len);
|
*data = (unsigned char *)malloc(len);
|
||||||
if(!*data)
|
if(!*data)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
rlen = len;
|
rlen = len;
|
||||||
if(!io_read(hfile,*data, &rlen) || (rlen != len))
|
if(!io_read(hfile,*data, &rlen) || (rlen != len))
|
||||||
return 0;
|
return 0;
|
||||||
@ -431,7 +431,7 @@ int wma_parse_stream_properties(IOHANDLE hfile, int size, MP3FILE *pmp3) {
|
|||||||
WMA_STREAM_PROP sp;
|
WMA_STREAM_PROP sp;
|
||||||
WMA_GUID *pguid;
|
WMA_GUID *pguid;
|
||||||
uint32_t len;
|
uint32_t len;
|
||||||
|
|
||||||
len = sizeof(sp);
|
len = sizeof(sp);
|
||||||
if(!io_read(hfile,(unsigned char *)&sp,&len) || (len != sizeof(sp)))
|
if(!io_read(hfile,(unsigned char *)&sp,&len) || (len != sizeof(sp)))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@ -1048,7 +1048,7 @@ int scan_get_wmainfo(char *filename, MP3FILE *pmp3) {
|
|||||||
|
|
||||||
pguid = wma_find_guid(subhdr.objectid);
|
pguid = wma_find_guid(subhdr.objectid);
|
||||||
if(pguid) {
|
if(pguid) {
|
||||||
DPRINTF(E_DBG,L_SCAN,"0x%08X: Found subheader: %s\n",
|
DPRINTF(E_DBG,L_SCAN,"%ll: Found subheader: %s\n",
|
||||||
offset,pguid->name);
|
offset,pguid->name);
|
||||||
if(strcmp(pguid->name,"ASF_Content_Description_Object")==0) {
|
if(strcmp(pguid->name,"ASF_Content_Description_Object")==0) {
|
||||||
res &= wma_parse_content_description(hfile,(int)subhdr.size,pmp3);
|
res &= wma_parse_content_description(hfile,(int)subhdr.size,pmp3);
|
||||||
|
@ -1198,7 +1198,7 @@ int ws_writefd(WS_CONNINFO *pwsc, char *fmt, ...) {
|
|||||||
|
|
||||||
len = (uint32_t)strlen(buffer);
|
len = (uint32_t)strlen(buffer);
|
||||||
if(!io_write(pwsc->hclient,(unsigned char *)buffer,&len)) {
|
if(!io_write(pwsc->hclient,(unsigned char *)buffer,&len)) {
|
||||||
ws_dprintf(L_WS_LOG,"Error writing to client socket: %s\n",
|
ws_dprintf(L_WS_DBG,"Error writing to client socket: %s\n",
|
||||||
io_errstr(pwsc->hclient));
|
io_errstr(pwsc->hclient));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1244,6 +1244,7 @@ int ws_returnerror(WS_CONNINFO *pwsc,int error, char *description) {
|
|||||||
char *useragent;
|
char *useragent;
|
||||||
int err_code;
|
int err_code;
|
||||||
char *err_str;
|
char *err_str;
|
||||||
|
int keep_alive = 0;
|
||||||
|
|
||||||
WS_ENTER();
|
WS_ENTER();
|
||||||
|
|
||||||
@ -1253,10 +1254,19 @@ int ws_returnerror(WS_CONNINFO *pwsc,int error, char *description) {
|
|||||||
|
|
||||||
/* we'll force a close here unless the user agent is
|
/* we'll force a close here unless the user agent is
|
||||||
iTunes, which seems to get pissy about it */
|
iTunes, which seems to get pissy about it */
|
||||||
|
|
||||||
useragent = ws_getarg(&pwsc->request_headers,"User-Agent");
|
useragent = ws_getarg(&pwsc->request_headers,"User-Agent");
|
||||||
if((useragent) &&
|
if((useragent) &&
|
||||||
(((strncmp(useragent,"iTunes",6) == 0) && (error == 401)) ||
|
(((strncmp(useragent,"iTunes",6) == 0) && (error == 401)) ||
|
||||||
((strncmp(useragent,"Java",4) == 0)))) {
|
((strncmp(useragent,"Java",4) == 0)))) {
|
||||||
|
keep_alive = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(error == 302) {
|
||||||
|
keep_alive = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(keep_alive) {
|
||||||
ws_addarg(&pwsc->response_headers,"Connection","keep-alive");
|
ws_addarg(&pwsc->response_headers,"Connection","keep-alive");
|
||||||
ws_addarg(&pwsc->response_headers,"Content-Length","2");
|
ws_addarg(&pwsc->response_headers,"Content-Length","2");
|
||||||
ws_emitheaders(pwsc);
|
ws_emitheaders(pwsc);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user