Small doc updates

pull/30/head
Jeroen Domburg 10 years ago
parent 784568c07f
commit 5a0e99d72e
  1. 2
      user/auth.c
  2. 1
      user/httpd.h
  3. 14
      user/user_main.c

@ -1,5 +1,5 @@
/* /*
HTTP auth implementation. HTTP auth implementation. Only does basic authentication for now.
*/ */
/* /*

@ -9,6 +9,7 @@
#define HTTPD_CGI_MORE 0 #define HTTPD_CGI_MORE 0
#define HTTPD_CGI_DONE 1 #define HTTPD_CGI_DONE 1
#define HTTPD_CGI_NOTFOUND 2 #define HTTPD_CGI_NOTFOUND 2
#define HTTPD_CGI_AUTHENTICATED 2 //for now
typedef struct HttpdPriv HttpdPriv; typedef struct HttpdPriv HttpdPriv;
typedef struct HttpdConnData HttpdConnData; typedef struct HttpdConnData HttpdConnData;

@ -29,7 +29,7 @@ int myPassFn(HttpdConnData *connData, int no, char *user, int userLen, char *pas
os_strcpy(user, "admin"); os_strcpy(user, "admin");
os_strcpy(pass, "s3cr3t"); os_strcpy(pass, "s3cr3t");
return 1; return 1;
//Add more users this way //Add more users this way. Check against incrementing no for each user added.
// } else if (no==1) { // } else if (no==1) {
// os_strcpy(user, "user1"); // os_strcpy(user, "user1");
// os_strcpy(pass, "something"); // os_strcpy(pass, "something");
@ -38,6 +38,17 @@ int myPassFn(HttpdConnData *connData, int no, char *user, int userLen, char *pas
return 0; return 0;
} }
/*
This is the main url->function dispatching data struct.
In short, it's a struct with various URLs plus their handlers. The handlers can
be 'standard' CGI functions you wrote, or 'special' CGIs requiring an argument.
They can also be auth-functions. An asterisk will match any url starting with
everything before the asterisks; "*" matches everything. The list will be
handled top-down, so make sure to put more specific rules above the more
general ones. Authorization things (like authBasic) act as a 'barrier' and
should be placed above the URLs they protect.
*/
HttpdBuiltInUrl builtInUrls[]={ HttpdBuiltInUrl builtInUrls[]={
{"/", cgiRedirect, "/index.tpl"}, {"/", cgiRedirect, "/index.tpl"},
{"/flash.bin", cgiReadFlash, NULL}, {"/flash.bin", cgiReadFlash, NULL},
@ -62,6 +73,7 @@ HttpdBuiltInUrl builtInUrls[]={
}; };
//Main routine. Initialize stdout, the I/O and the webserver and we're done.
void user_init(void) { void user_init(void) {
stdoutInit(); stdoutInit();
ioInit(); ioInit();

Loading…
Cancel
Save