* Properly skip sorting on UPnPSearches of very large containers on sparc-based ReadyNAS processors.

This commit is contained in:
Justin Maggard
2009-04-30 23:58:27 +00:00
parent 226cf8bb66
commit a67c054ef7
3 changed files with 25 additions and 15 deletions

View File

@ -639,11 +639,6 @@ BrowseContentDirectory(struct upnphttp * h, const char * action)
if( !RequestedCount )
RequestedCount = -1;
#ifdef __sparc__ /* Sorting takes too long on slow processors with very large containers */
if( totalMatches < 10000 )
#endif
orderBy = parse_sort_criteria(SortCriteria);
args.resp = resp;
args.size = sprintf(resp, "%s", resp0);
@ -699,6 +694,11 @@ BrowseContentDirectory(struct upnphttp * h, const char * action)
totalMatches = atoi(result[1]);
sqlite3_free_table(result);
}
#ifdef __sparc__ /* Sorting takes too long on slow processors with very large containers */
if( totalMatches < 10000 )
#endif
orderBy = parse_sort_criteria(SortCriteria);
sql = sqlite3_mprintf( SELECT_COLUMNS
"from OBJECTS o left join DETAILS d on (d.ID = o.DETAIL_ID)"
" where PARENT_ID = '%s' %s limit %d, %d;",
@ -767,10 +767,6 @@ SearchContentDirectory(struct upnphttp * h, const char * action)
if( !RequestedCount )
RequestedCount = -1;
#ifdef __sparc__ /* Sorting takes too long on slow processors with very large containers */
if( totalMatches < 10000 )
#endif
orderBy = parse_sort_criteria(SortCriteria);
args.resp = resp;
args.size = sprintf(resp, "%s", resp0);
@ -872,6 +868,10 @@ SearchContentDirectory(struct upnphttp * h, const char * action)
totalMatches = atoi(result[1]);
sqlite3_free_table(result);
}
#ifdef __sparc__ /* Sorting takes too long on slow processors with very large containers */
if( totalMatches < 10000 )
#endif
orderBy = parse_sort_criteria(SortCriteria);
sql = sqlite3_mprintf( SELECT_COLUMNS
"from OBJECTS o left join DETAILS d on (d.ID = o.DETAIL_ID)"