aboutsummaryrefslogtreecommitdiff
path: root/src/Content.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/Content.c')
-rw-r--r--src/Content.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/src/Content.c b/src/Content.c
index 357c04d..b32c516 100644
--- a/src/Content.c
+++ b/src/Content.c
@@ -123,12 +123,26 @@ HTTP_SendString( httpRequest *request, const String * message )
void
HTTP_Send_OK_Header( httpRequest *request )
{
+ HTTP_Send_OK_Refresh_Header( request, -1 );
+}
+
+void
+HTTP_Send_OK_Refresh_Header( httpRequest *request, int secs )
+{
/* Status message */
HTTP_Send(request, "HTTP/1.0 200 OK\r\n");
-
/* Content-Type */
HTTP_Send(request, "Content-Type: text/html\r\n");
- HTTP_Send(request, "\r\n");
+
+ if( secs >= 0 )
+ {
+ String * timeString = String_Make( "Refresh: " );
+ ConcatDecimal( timeString, secs );
+ ConcatCString( timeString, "\r\n" );
+ HTTP_SendString( request, timeString );
+ String_Delete( timeString );
+ }
+ HTTP_Send( request, "\r\n" );
}
void
@@ -375,7 +389,7 @@ static int MainPage(const cGH *cctkGH, httpRequest *request, void *data)
/* avoid compiler warning about unused parameter */
data = data;
- HTTP_Send_OK_Header( request );
+ HTTP_Send_OK_Refresh_Header( request, refresh_seconds );
HTTP_SetDoctype( message );
HTTP_SendString(request, message);