[daap] DAAPD 0.2.4a fix for iTunes 4.5+

Fixing DAAPD 0.2.4a for iTunes 5 and 6

Following kosh_003's suggestion, I changed 'int parsePath' in daapd.cc before 'make.' Basically, the strncmp function (case-sensitive comparison of not-more-than n characters of a string with another) is replaced with strcasestr (case-insensitive check for string in a string). With this (and with this too in case of Mac OS 10.4, DAAPD 0.2.4 installation on Mac OS 10.4), DAAPD 0.2.4a works with iTunes 5 or 6.0.1 clients on both Windows 2000 and Mac OS 10.4 (over Rendezvous Proxy and Network Beacon).

 int parsePath( httpd *server, Request &request ) {
	char *path = httpdRequestPath( server );
	// first resolve the path to a request number
	if ( strcasestr( path, "/server-info" )!= NULL ) {
		request.number = DAAP_SERVINFO;
	} else if ( strcasestr( path, "/content-codes" )!= NULL ) {
		request.number = DAAP_CONTCODES;
	} else if ( strcasestr( path, "/login" ) != NULL ) {
		request.number = DAAP_LOGIN;
	} else if ( strcasestr( path, "/logout" ) != NULL ) {
		request.number = DAAP_LOGOUT;
	} else if ( strcasestr( path, "/update" ) != NULL ) {
		request.number = DAAP_UPDATE;
	} else if ( strcasestr( path, "/databases" ) != NULL ) {
		request.number = DAAP_DATABASES;
 // no resolve or browse yet
 //	} else if ( strncmp( path, "/resolve", sizeof("/resolve") - 1 ) == 0 ) {
 //		request.number = DAAP_RESOLVE;
 //	} else if ( strncmp( path, "/browse", sizeof("/browse") - 1 ) == 0 ) {
 //		request.number = DAAP_BROWSE;
	// Administration: Not part of DAAP
	} else if ( strcasestr( path, "/admin" ) != NULL ) {
		request.number = DAAP_ADMIN;
	} else {
		httpdSend400( server );
		return -1;
	}
	return 0;
 }

- alpha2zee, Nov 17, 2005


EditText of this page (last edited 17. November (18:49:46)) [info] [diff])
FindPage by browsing or searching
5 best incoming links: DAAPD 0.2.4 installation on Mac OS 10.4 (7), RecentChanges (4), FrontPage (2),
5 best outgoing links: DAAPD 0.2.4 installation on Mac OS 10.4 (7),
5 most popular nearby: FrontPage (110786), RecentChanges (12045), DAAPD 0.2.4 installation on Mac OS 10.4 (5532),