Skip to content

Commit e666b49

Browse files
author
Sebastiano Merlino
committed
Enabled Shoutcast:
- Added flag ti support shoutcast response - Modified response in order to be able to automatically set ShoutCAST flag
1 parent 683c4ad commit e666b49

File tree

4 files changed

+6
-0
lines changed

4 files changed

+6
-0
lines changed

src/HttpResponse.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ void HttpResponse::HttpResponseInit
5656
{
5757
this->content = content;
5858
this->responseCode = responseCode;
59+
if(responseType == HttpResponse::SHOUTCAST_CONTENT)
60+
this->responseCode |= HttpUtils::shoutcast_response;
5961
this->setHeader(HttpUtils::http_header_content_type, contentType);
6062
this->fp = -1;
6163
}

src/HttpUtils.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ const int HttpUtils::http_insufficient_storage = MHD_HTTP_INSUFFICIENT_STORAGE;
9696
const int HttpUtils::http_bandwidth_limit_exceeded = MHD_HTTP_BANDWIDTH_LIMIT_EXCEEDED;
9797
const int HttpUtils::http_not_extended = MHD_HTTP_NOT_EXTENDED;
9898

99+
const int HttpUtils::shoutcast_response = MHD_ICY_FLAG;
99100

100101
const std::string HttpUtils::http_header_accept = MHD_HTTP_HEADER_ACCEPT;
101102
const std::string HttpUtils::http_header_accept_charset = MHD_HTTP_HEADER_ACCEPT_CHARSET;

src/httpserver/HttpResponse.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ class HttpResponse
4949
{
5050
STRING_CONTENT = 0,
5151
FILE_CONTENT,
52+
SHOUTCAST_CONTENT,
5253
DIGEST_AUTH_FAIL,
5354
BASIC_AUTH_FAIL
5455
};

src/httpserver/HttpUtils.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,8 @@ class HttpUtils
139139
static const int http_bandwidth_limit_exceeded;
140140
static const int http_not_extended;
141141

142+
static const int shoutcast_response;
143+
142144
/* See also: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html */
143145
static const std::string http_header_accept;
144146
static const std::string http_header_accept_charset;

0 commit comments

Comments
 (0)