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:

committed by
Marcelo Roberto Jimenez

parent
467f9987a1
commit
2fcbe6df52
@@ -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 )
|
||||
|
Reference in New Issue
Block a user