taskrambler  v0.1.8
Web server and task management solution.
500.c File Reference
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <sys/types.h>
#include "class.h"
#include "http/response.h"
#include "http/message.h"
#include "http/header.h"
#include "utils/memory.h"
#include "hash.h"
+ Include dependency graph for 500.c:

Go to the source code of this file.

Macros

#define RESP_DATA
 

Functions

HttpResponse httpResponse500 ()
 

Detailed Description

Author
Georg Hopp

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Definition in file 500.c.

Macro Definition Documentation

#define RESP_DATA
Value:
"<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n" \
"<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"\n" \
" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n" \
"<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n" \
"<head><title>500 - Internal Server Error</title></head>" \
"<body><h1>500 - Internal Server Error</h1></body>" \
"</html>"

Definition at line 37 of file 500.c.

Referenced by httpResponse500().

Function Documentation

HttpResponse httpResponse500 ( )

Definition at line 47 of file 500.c.

References CSTRA, hashAdd(), memMalloc(), and RESP_DATA.

Referenced by httpWorkerProcess().

48 {
49  HttpResponse response;
50  HttpMessage message;
51 
52  response = new(HttpResponse, "HTTP/1.1", 500, "Internal Server Error");
53  message = (HttpMessage)response;
54 
55  hashAdd(message->header,
56  new(HttpHeader, CSTRA("Content-Type"), CSTRA("text/html")));
57 
58  message->nbody = sizeof(RESP_DATA) - 1;
59  message->body = memMalloc(sizeof(RESP_DATA));
60  memcpy(message->body, RESP_DATA, sizeof(RESP_DATA));
61 
62  return response;
63 }
void * memMalloc(size_t)
Definition: memory.c:783
#define CSTRA(val)
Const STRing Argument.
Definition: memory.h:26
#define RESP_DATA
Definition: 500.c:37
void * hashAdd(Hash, void *)
Definition: add.c:48

+ Here is the call graph for this function:

+ Here is the caller graph for this function: