This callback function must be implemented by user. It is called each time a web page is requested or data is received.
1 int32_t http_interpreter (httpserv_type *http_server)
3 // ************************************************************************
5 // ************************************************************************
6 int32_t ret = _HTTP_CLOSE_CONNECTION;
8 // ************************************************************************
9 // Execute specific method
10 // ************************************************************************
11 switch (http_server -> method)
14 if ( http_server -> uri == -1 )
16 // ************************************************************
17 // uri not found: send user defined not-found-message
18 // ************************************************************
20 http_send_uri (http_server, &e404);
24 // ************************************************************
25 // send the requested page
26 // ************************************************************
27 if ( http_send_user_page (http_server,
29 http_server -> uri ) <= 0)
31 // *********************************************************
32 // page could not be sent immediately, keep connection alive
33 // and try again later
34 // *********************************************************
35 ret = _HTTP_KEEP_ALIVE;
40 case _HTTP_UNKNOWN : // unknown method
41 // ****************************************************************
42 // method not implemented or syntax error
43 // ****************************************************************
44 http_send_uri (http_server, &e501);
48 // ************************************************************************
49 // back to http server
50 // ************************************************************************
285 switch (http_server-> method)
291 if ( http_server-> uri == -1 )
319 for ( i = 1; i<http_server-> argc;i++)
321 if ( !strncmp (http_server-> argv[i],
"Led1", 4) )
325 if ( !strncmp (http_server-> argv[i],
"Led2", 4) )
329 if ( !strncmp (http_server-> argv[i],
"Led3", 4) )
333 if ( !strncmp (http_server-> argv[i],
"Led4", 4) )
350 http_server-> uri ) <=
INT32_C(0))
#define _HTTP_KEEP_ALIVE
Definition: httplib.h:98
int32_t http_send_user_page(httpserv_type *http_info, user_type *puser, int32_t uri)
Send user defined webpage.
#define INT32_C(value)
Definition: stdint.h:209
direntry_type e404
Definition: webpage.c:63
int32_t index
Definition: net.h:813
direntry_type led1
Definition: HTTPdynamic.c:164
#define _HTTP_CLOSE_CONNECTION
Definition: httplib.h:99
direntry_type led3
Definition: HTTPdynamic.c:166
#define _HTTP_UNKNOWN
Definition: httplib.h:110
direntry_type index
Definition: webpage.c:132
direntry_type led4
Definition: HTTPdynamic.c:167
direntry_type e501
Definition: webpage.c:81
user_type user[]
Definition: FTPclient.c:168
void UpdateLedStates(void)
Definition: HTTPdynamic.c:184
direntry_type led2
Definition: HTTPdynamic.c:165
int32_t http_send_uri(httpserv_type *http_server, direntry_type *uri)
Send URI using the specified URI without looking up in user list.
void toggle_led(direntry_type *fp, unsigned int led_nr)
Definition: HTTPdynamic.c:233
int int32_t
Definition: stdint.h:46
#define _HTTP_GET
Definition: httplib.h:106