Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/azatoth/minidlna.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Maggard <jmaggard@users.sourceforce.net>2012-02-17 05:21:14 +0400
committerJustin Maggard <jmaggard@users.sourceforce.net>2012-02-17 05:21:14 +0400
commit53406ab1c266cb36b1926230e73b3fee25eaceaf (patch)
treef1a3198f802c5de565e7d9f55dda41ddbca22b99
parente4d33102eb2b31f1d8aeab5f57bde9b3b6dd579b (diff)
* Force strict error checking a couple other places when strict_dlna mode is enabled.
-rw-r--r--upnpsoap.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/upnpsoap.c b/upnpsoap.c
index 64982fb..0e8dbee 100644
--- a/upnpsoap.c
+++ b/upnpsoap.c
@@ -578,7 +578,7 @@ parse_sort_criteria(char *sortCriteria, int *error)
}
else
{
- DPRINTF(E_DEBUG, L_HTTP, "No order specified [%s]\n", item);
+ DPRINTF(E_ERROR, L_HTTP, "No order specified [%s]\n", item);
*error = -1;
goto unhandled_order;
}
@@ -605,7 +605,7 @@ parse_sort_criteria(char *sortCriteria, int *error)
}
else
{
- DPRINTF(E_DEBUG, L_HTTP, "Unhandled SortCriteria [%s]\n", item);
+ DPRINTF(E_ERROR, L_HTTP, "Unhandled SortCriteria [%s]\n", item);
*error = -1;
if( i )
{
@@ -1284,7 +1284,7 @@ BrowseContentDirectory(struct upnphttp * h, const char * action)
}
}
/* If it's a DLNA client, return an error for bad sort criteria */
- if( (args.flags & FLAG_DLNA) && ret < 0 )
+ if( ret < 0 && ((args.flags & FLAG_DLNA) || GETFLAG(DLNA_STRICT_MASK)) )
{
SoapError(h, 709, "Unsupported or invalid sort criteria");
goto browse_error;
@@ -1297,12 +1297,14 @@ BrowseContentDirectory(struct upnphttp * h, const char * action)
DPRINTF(E_DEBUG, L_HTTP, "Browse SQL: %s\n", sql);
ret = sqlite3_exec(db, sql, callback, (void *) &args, &zErrMsg);
}
- sqlite3_free(sql);
if( (ret != SQLITE_OK) && (zErrMsg != NULL) )
{
DPRINTF(E_WARN, L_HTTP, "SQL error: %s\nBAD SQL: %s\n", zErrMsg, sql);
sqlite3_free(zErrMsg);
+ SoapError(h, 709, "Unsupported or invalid sort criteria");
+ goto browse_error;
}
+ sqlite3_free(sql);
/* Does the object even exist? */
if( !totalMatches )
{
@@ -1496,7 +1498,7 @@ SearchContentDirectory(struct upnphttp * h, const char * action)
#endif
orderBy = parse_sort_criteria(SortCriteria, &ret);
/* If it's a DLNA client, return an error for bad sort criteria */
- if( (args.flags & FLAG_DLNA) && ret < 0 )
+ if( ret < 0 && ((args.flags & FLAG_DLNA) || GETFLAG(DLNA_STRICT_MASK)) )
{
SoapError(h, 709, "Unsupported or invalid sort criteria");
goto search_error;