Tune down logging a bit more

This commit is contained in:
Ron Pedde 2007-09-25 07:50:48 +00:00
parent 208ef6b1f2
commit a921916f30
3 changed files with 19 additions and 11 deletions

View File

@ -145,10 +145,9 @@ uint64_t scan_aac_findatom(IOHANDLE hfile, uint64_t max_offset,
char atom[4];
uint32_t bytes_read;
while(current_offset < max_offset) {
while((current_offset + 8) < max_offset) {
bytes_read = sizeof(uint32_t);
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;
}
@ -162,7 +161,6 @@ uint64_t scan_aac_findatom(IOHANDLE hfile, uint64_t max_offset,
bytes_read = 4;
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;
}

View File

@ -1048,7 +1048,7 @@ int scan_get_wmainfo(char *filename, MP3FILE *pmp3) {
pguid = wma_find_guid(subhdr.objectid);
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);
if(strcmp(pguid->name,"ASF_Content_Description_Object")==0) {
res &= wma_parse_content_description(hfile,(int)subhdr.size,pmp3);

View File

@ -1198,7 +1198,7 @@ int ws_writefd(WS_CONNINFO *pwsc, char *fmt, ...) {
len = (uint32_t)strlen(buffer);
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));
}
@ -1244,6 +1244,7 @@ int ws_returnerror(WS_CONNINFO *pwsc,int error, char *description) {
char *useragent;
int err_code;
char *err_str;
int keep_alive = 0;
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
iTunes, which seems to get pissy about it */
useragent = ws_getarg(&pwsc->request_headers,"User-Agent");
if((useragent) &&
(((strncmp(useragent,"iTunes",6) == 0) && (error == 401)) ||
((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,"Content-Length","2");
ws_emitheaders(pwsc);