Addition of WEB_SERVER_CONTENT_LANGUAGE parameter
This patch adds the WEB_SERVER_CONTENT_LANGUAGE parameter so the user can specify the language used by the device during Description and Presentation steps of UPnP through the HTTP CONTENT-LANGUAGE header. By default, the WEB_SERVER_CONTENT_LANGUAGE is an empty string so no CONTENT-LANGUAGE is added.
This commit is contained in:
parent
467f9987a1
commit
2fcbe6df52
10
ChangeLog
10
ChangeLog
@ -2,6 +2,16 @@
|
||||
Version 1.6.7
|
||||
*******************************************************************************
|
||||
|
||||
2010-09-21 Fabrice Fontaine <fabrice.fontaine(at)orange-ftgroup.com>
|
||||
|
||||
Addition of WEB_SERVER_CONTENT_LANGUAGE parameter
|
||||
|
||||
This patch adds the WEB_SERVER_CONTENT_LANGUAGE parameter so the user can specify
|
||||
the language used by the device during Description and Presentation steps of UPnP
|
||||
through the HTTP CONTENT-LANGUAGE header.
|
||||
By default, the WEB_SERVER_CONTENT_LANGUAGE is an empty string so no
|
||||
CONTENT-LANGUAGE is added.
|
||||
|
||||
2010-09-18 Fabrice Fontaine <fabrice.fontaine(at)orange-ftgroup.com>
|
||||
|
||||
Customize the stack size of the threads used by pupnp through the new THREAD_STACK_SIZE variable
|
||||
|
@ -192,6 +192,20 @@
|
||||
#define WEB_SERVER_BUF_SIZE (1024*1024)
|
||||
/* @} */
|
||||
|
||||
/*!
|
||||
* \name WEB_SERVER_CONTENT_LANGUAGE
|
||||
*
|
||||
* This configuration parameter sets the value of the Content-Language
|
||||
* header for the webserver. Thanks to this parameter, the use can advertize
|
||||
* the language used by the device in the description (friendlyName) and
|
||||
* presentation steps of UPnP. The default value is empty string so no
|
||||
* Content-Language header is added.
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
#define WEB_SERVER_CONTENT_LANGUAGE ""
|
||||
/* @} */
|
||||
|
||||
/*!
|
||||
* \name AUTO_RENEW_TIME
|
||||
*
|
||||
|
@ -1908,6 +1908,8 @@ http_SendStatusResponse( IN SOCKINFO * info,
|
||||
* 'G': arg = range information // add range header
|
||||
* 'h': arg = off_t number // appends off_t number
|
||||
* 'K': (no args) // add chunky header
|
||||
* 'L': (no args) appends HTTP Content-Language: header if
|
||||
* WEB_SERVER_CONTENT_LANGUAGE is not empty
|
||||
* 'N': arg1 = off_t content_length // content-length header
|
||||
* 'q': arg1 = http_method_t // request start line and HOST header
|
||||
* arg2 = (uri_type *)
|
||||
@ -2051,6 +2053,15 @@ http_MakeMessage( INOUT membuffer * buf,
|
||||
if( membuffer_append( buf, tempbuf, strlen( tempbuf ) ) != 0 ) {
|
||||
goto error_handler;
|
||||
}
|
||||
} else if ( c == 'L' ) {
|
||||
// Add CONTENT-LANGUAGE header only if WEB_SERVER_CONTENT_LANGUAGE
|
||||
// is not empty
|
||||
if (strcmp( WEB_SERVER_CONTENT_LANGUAGE, "" ) && http_MakeMessage(
|
||||
buf, http_major_version, http_minor_version,
|
||||
"ssc",
|
||||
"CONTENT-LANGUAGE: ", WEB_SERVER_CONTENT_LANGUAGE ) != 0 ) {
|
||||
goto error_handler;
|
||||
}
|
||||
} else if( c == 'C' ) {
|
||||
if( ( http_major_version > 1 ) ||
|
||||
( http_major_version == 1 && http_minor_version == 1 )
|
||||
|
@ -1398,7 +1398,7 @@ process_request( IN http_message_t * req,
|
||||
// Transfer-Encoding: chunked
|
||||
if (http_MakeMessage(
|
||||
headers, resp_major, resp_minor,
|
||||
"R" "T" "GKD" "s" "tcS" "Xc" "sCc",
|
||||
"R" "T" "GKLD" "s" "tcS" "Xc" "sCc",
|
||||
HTTP_PARTIAL_CONTENT, // status code
|
||||
finfo.content_type, // content type
|
||||
RespInstr, // range info
|
||||
@ -1413,7 +1413,7 @@ process_request( IN http_message_t * req,
|
||||
// Transfer-Encoding: chunked
|
||||
if (http_MakeMessage(
|
||||
headers, resp_major, resp_minor,
|
||||
"R" "N" "T" "GD" "s" "tcS" "Xc" "sCc",
|
||||
"R" "N" "T" "GLD" "s" "tcS" "Xc" "sCc",
|
||||
HTTP_PARTIAL_CONTENT, // status code
|
||||
RespInstr->ReadSendSize, // content length
|
||||
finfo.content_type, // content type
|
||||
@ -1430,7 +1430,7 @@ process_request( IN http_message_t * req,
|
||||
// Transfer-Encoding: chunked
|
||||
if (http_MakeMessage(
|
||||
headers, resp_major, resp_minor,
|
||||
"RK" "TD" "s" "tcS" "Xc" "sCc",
|
||||
"RK" "TLD" "s" "tcS" "Xc" "sCc",
|
||||
HTTP_OK, // status code
|
||||
finfo.content_type, // content type
|
||||
"LAST-MODIFIED: ",
|
||||
@ -1446,7 +1446,7 @@ process_request( IN http_message_t * req,
|
||||
// Transfer-Encoding: chunked
|
||||
if (http_MakeMessage(
|
||||
headers, resp_major, resp_minor,
|
||||
"R" "N" "TD" "s" "tcS" "Xc" "sCc",
|
||||
"R" "N" "TLD" "s" "tcS" "Xc" "sCc",
|
||||
HTTP_OK, // status code
|
||||
RespInstr->ReadSendSize, // content length
|
||||
finfo.content_type, // content type
|
||||
@ -1461,7 +1461,7 @@ process_request( IN http_message_t * req,
|
||||
// Transfer-Encoding: chunked
|
||||
if (http_MakeMessage(
|
||||
headers, resp_major, resp_minor,
|
||||
"R" "TD" "s" "tcS" "b" "Xc" "sCc",
|
||||
"R" "TLD" "s" "tcS" "b" "Xc" "sCc",
|
||||
HTTP_OK, // status code
|
||||
finfo.content_type, // content type
|
||||
"LAST-MODIFIED: ",
|
||||
@ -1751,7 +1751,7 @@ web_server_callback( IN http_parser_t * parser,
|
||||
|
||||
http_MakeMessage(
|
||||
&headers, 1, 1,
|
||||
"RTDSXcCc",
|
||||
"RLTDSXcCc",
|
||||
ret,
|
||||
"text/html",
|
||||
X_USER_AGENT );
|
||||
|
@ -192,6 +192,20 @@
|
||||
#define WEB_SERVER_BUF_SIZE (1024*1024)
|
||||
/* @} */
|
||||
|
||||
/*!
|
||||
* \name WEB_SERVER_CONTENT_LANGUAGE
|
||||
*
|
||||
* This configuration parameter sets the value of the Content-Language
|
||||
* header for the webserver. Thanks to this parameter, the use can advertize
|
||||
* the language used by the device in the description (friendlyName) and
|
||||
* presentation steps of UPnP. The default value is empty string so no
|
||||
* Content-Language header is added.
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
#define WEB_SERVER_CONTENT_LANGUAGE ""
|
||||
/* @} */
|
||||
|
||||
/*!
|
||||
* \name AUTO_RENEW_TIME
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user