output/httpd: added name/genre/website configuration
This commit is contained in:
		 James Pike
					James Pike
				
			
				
					committed by
					
						 Max Kellermann
						Max Kellermann
					
				
			
			
				
	
			
			
			 Max Kellermann
						Max Kellermann
					
				
			
						parent
						
							50c0c4b701
						
					
				
				
					commit
					c52f469c9c
				
			| @@ -282,11 +282,12 @@ httpd_client_send_response(struct httpd_client *client) | ||||
| 	} else { | ||||
| 		gchar *metadata_header; | ||||
|  | ||||
| 		metadata_header = icy_server_metadata_header("Add config information here!", /* TODO */ | ||||
| 							     "Add config information here!", /* TODO */ | ||||
| 							     "Add config information here!", /* TODO */ | ||||
| 							     client->httpd->content_type, | ||||
| 							     client->metaint); | ||||
| 		metadata_header = icy_server_metadata_header( | ||||
| 			client->httpd->name, | ||||
| 			client->httpd->genre, | ||||
| 			client->httpd->website, | ||||
| 			client->httpd->content_type, | ||||
| 			client->metaint); | ||||
|  | ||||
| 		g_strlcpy(buffer, metadata_header, sizeof(buffer)); | ||||
|  | ||||
|   | ||||
| @@ -98,6 +98,19 @@ struct httpd_output { | ||||
| 	 */ | ||||
| 	struct page *metadata; | ||||
|  | ||||
| 	/** | ||||
| 	 * The configured name. | ||||
| 	 */ | ||||
| 	char const *name; | ||||
| 	/** | ||||
| 	 * The configured genre. | ||||
| 	 */ | ||||
| 	char const *genre; | ||||
| 	/** | ||||
| 	 * The configured website address. | ||||
| 	 */ | ||||
| 	char const *website; | ||||
|  | ||||
| 	/** | ||||
| 	 * A linked list containing all clients which are currently | ||||
| 	 * connected. | ||||
|   | ||||
| @@ -111,6 +111,12 @@ httpd_output_init(G_GNUC_UNUSED const struct audio_format *audio_format, | ||||
| 	struct sockaddr_in *sin; | ||||
|  | ||||
| 	/* read configuration */ | ||||
| 	httpd->name = | ||||
| 		config_get_block_string(param, "name", "Set name in config"); | ||||
| 	httpd->genre = | ||||
| 		config_get_block_string(param, "genre", "Set genre in config"); | ||||
| 	httpd->website = | ||||
| 		config_get_block_string(param, "website", "Set website in config"); | ||||
|  | ||||
| 	port = config_get_block_unsigned(param, "port", 8000); | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user