diff options
author | Justin Maggard <jmaggard@users.sourceforce.net> | 2011-04-29 03:01:28 +0400 |
---|---|---|
committer | Justin Maggard <jmaggard@users.sourceforce.net> | 2011-04-29 03:01:28 +0400 |
commit | 458a34cd1e8d4513bc6db0d8d944de6f09408b54 (patch) | |
tree | c7c5451fcb8007dad0f57f80d10eca30ab07d742 /upnpsoap.c | |
parent | b7ef97b59397f50fc24168e651d5e7a459e94734 (diff) |
* Fix a couple minor DLNA correctness issues.
Diffstat (limited to 'upnpsoap.c')
-rw-r--r-- | upnpsoap.c | 23 |
1 files changed, 11 insertions, 12 deletions
@@ -769,13 +769,13 @@ callback(void *args, int argc, char **argv, char **azColName) passed_args->size += ret; } if( artist ) { - if( (*mime == 'a') && (passed_args->filter & FILTER_UPNP_ARTIST) ) { - ret = snprintf(str_buf, 512, "<upnp:artist>%s</upnp:artist>", artist); + if( (*mime == 'v') && (passed_args->filter & FILTER_UPNP_ACTOR) ) { + ret = snprintf(str_buf, 512, "<upnp:actor>%s</upnp:actor>", artist); memcpy(passed_args->resp+passed_args->size, &str_buf, ret+1); passed_args->size += ret; } - else if( (*mime == 'v') && (passed_args->filter & FILTER_UPNP_ACTOR) ) { - ret = snprintf(str_buf, 512, "<upnp:actor>%s</upnp:actor>", artist); + if( passed_args->filter & FILTER_UPNP_ARTIST ) { + ret = snprintf(str_buf, 512, "<upnp:artist>%s</upnp:artist>", artist); memcpy(passed_args->resp+passed_args->size, &str_buf, ret+1); passed_args->size += ret; } @@ -1321,13 +1321,14 @@ SearchContentDirectory(struct upnphttp * h, const char * action) groupBy[0] = '\0'; if( !SearchCriteria ) { - asprintf(&newSearchCriteria, "1 = 1"); + newSearchCriteria = strdup("1 = 1"); SearchCriteria = newSearchCriteria; } else { SearchCriteria = modifyString(SearchCriteria, """, "\"", 0); SearchCriteria = modifyString(SearchCriteria, "'", "'", 0); + SearchCriteria = modifyString(SearchCriteria, "\\\"", "\"\"", 0); SearchCriteria = modifyString(SearchCriteria, "object.", "", 0); SearchCriteria = modifyString(SearchCriteria, "derivedfrom", "like", 1); SearchCriteria = modifyString(SearchCriteria, "contains", "like", 2); @@ -1343,16 +1344,14 @@ SearchContentDirectory(struct upnphttp * h, const char * action) SearchCriteria = modifyString(SearchCriteria, "@refID", "REF_ID", 0); if( strstr(SearchCriteria, "@id") ) { - newSearchCriteria = modifyString(strdup(SearchCriteria), "@id", "OBJECT_ID", 0); - SearchCriteria = newSearchCriteria; + newSearchCriteria = strdup(SearchCriteria); + newSearchCriteria = SearchCriteria = modifyString(newSearchCriteria, "@id", "OBJECT_ID", 0); } if( strstr(SearchCriteria, "res is ") ) { - if( newSearchCriteria ) - newSearchCriteria = modifyString(newSearchCriteria, "res is ", "MIME is ", 0); - else - newSearchCriteria = modifyString(strdup(SearchCriteria), "res is ", "MIME is ", 0); - SearchCriteria = newSearchCriteria; + if( !newSearchCriteria ) + newSearchCriteria = strdup(SearchCriteria); + newSearchCriteria = SearchCriteria = modifyString(newSearchCriteria, "res is ", "MIME is ", 0); } #if 0 // Does 360 need this? if( strstr(SearchCriteria, "&") ) |