Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: oldheating gps motorhome heating
web-base.c@103:91194cc19bbb, 2019-04-27 (annotated)
- Committer:
- andrewboyson
- Date:
- Sat Apr 27 09:25:28 2019 +0000
- Revision:
- 103:91194cc19bbb
- Child:
- 104:40097d08edd5
- Child:
- 105:43ef124233cd
Renamed everything from Http to Web
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| andrewboyson | 103:91194cc19bbb | 1 | #include "web-base.h" |
| andrewboyson | 103:91194cc19bbb | 2 | #include "web-derived.h" |
| andrewboyson | 103:91194cc19bbb | 3 | #include "http.h" |
| andrewboyson | 103:91194cc19bbb | 4 | #include "fault.h" |
| andrewboyson | 103:91194cc19bbb | 5 | #include "led.h" |
| andrewboyson | 103:91194cc19bbb | 6 | #include "mstimer.h" |
| andrewboyson | 103:91194cc19bbb | 7 | |
| andrewboyson | 103:91194cc19bbb | 8 | #define DO_LOGIN DO_SERVER + 0 |
| andrewboyson | 103:91194cc19bbb | 9 | #define DO_FAVICON DO_SERVER + 1 |
| andrewboyson | 103:91194cc19bbb | 10 | #define DO_BASE_CSS DO_SERVER + 2 |
| andrewboyson | 103:91194cc19bbb | 11 | #define DO_NAV_CSS DO_SERVER + 3 |
| andrewboyson | 103:91194cc19bbb | 12 | #define DO_TRACE_HTML DO_SERVER + 4 |
| andrewboyson | 103:91194cc19bbb | 13 | #define DO_TRACE_AJAX DO_SERVER + 5 |
| andrewboyson | 103:91194cc19bbb | 14 | #define DO_TRACE_SCRIPT DO_SERVER + 6 |
| andrewboyson | 103:91194cc19bbb | 15 | #define DO_CLOCK_HTML DO_SERVER + 7 |
| andrewboyson | 103:91194cc19bbb | 16 | #define DO_CLOCK_AJAX DO_SERVER + 8 |
| andrewboyson | 103:91194cc19bbb | 17 | #define DO_CLOCK_SCRIPT DO_SERVER + 9 |
| andrewboyson | 103:91194cc19bbb | 18 | #define DO_NET_HTML DO_SERVER + 10 |
| andrewboyson | 103:91194cc19bbb | 19 | #define DO_NET4_HTML DO_SERVER + 11 |
| andrewboyson | 103:91194cc19bbb | 20 | #define DO_NET4_AJAX DO_SERVER + 12 |
| andrewboyson | 103:91194cc19bbb | 21 | #define DO_NET4_SCRIPT DO_SERVER + 13 |
| andrewboyson | 103:91194cc19bbb | 22 | #define DO_NET6_HTML DO_SERVER + 14 |
| andrewboyson | 103:91194cc19bbb | 23 | #define DO_NET6_AJAX DO_SERVER + 15 |
| andrewboyson | 103:91194cc19bbb | 24 | #define DO_NET6_SCRIPT DO_SERVER + 16 |
| andrewboyson | 103:91194cc19bbb | 25 | #define DO_LOG_HTML DO_SERVER + 17 |
| andrewboyson | 103:91194cc19bbb | 26 | #define DO_FAULT_HTML DO_SERVER + 18 |
| andrewboyson | 103:91194cc19bbb | 27 | #define DO_FIRMWARE_HTML DO_SERVER + 19 |
| andrewboyson | 103:91194cc19bbb | 28 | #define DO_FIRMWARE_AJAX DO_SERVER + 20 |
| andrewboyson | 103:91194cc19bbb | 29 | #define DO_FIRMWARE_SCRIPT DO_SERVER + 21 |
| andrewboyson | 103:91194cc19bbb | 30 | #define DO_1WIRE_HTML DO_SERVER + 22 |
| andrewboyson | 103:91194cc19bbb | 31 | #define DO_1WIRE_AJAX DO_SERVER + 23 |
| andrewboyson | 103:91194cc19bbb | 32 | #define DO_1WIRE_SCRIPT DO_SERVER + 24 |
| andrewboyson | 103:91194cc19bbb | 33 | #define DO_SEND_SESSION_ID DO_DERIVED + 100 |
| andrewboyson | 103:91194cc19bbb | 34 | |
| andrewboyson | 103:91194cc19bbb | 35 | #define LOGIN_DELAY_MS 200 |
| andrewboyson | 103:91194cc19bbb | 36 | |
| andrewboyson | 103:91194cc19bbb | 37 | static int decideWhatToDoFromPath(char *pPath, char* pLastModified) |
| andrewboyson | 103:91194cc19bbb | 38 | { |
| andrewboyson | 103:91194cc19bbb | 39 | if (HttpSameStr(pPath, "/login" )) return DO_LOGIN; |
| andrewboyson | 103:91194cc19bbb | 40 | if (HttpSameStr(pPath, "/clock" )) return DO_CLOCK_HTML; |
| andrewboyson | 103:91194cc19bbb | 41 | if (HttpSameStr(pPath, "/clock-ajax" )) return DO_CLOCK_AJAX; |
| andrewboyson | 103:91194cc19bbb | 42 | if (HttpSameStr(pPath, "/net" )) return DO_NET_HTML; |
| andrewboyson | 103:91194cc19bbb | 43 | if (HttpSameStr(pPath, "/net4" )) return DO_NET4_HTML; |
| andrewboyson | 103:91194cc19bbb | 44 | if (HttpSameStr(pPath, "/net4-ajax" )) return DO_NET4_AJAX; |
| andrewboyson | 103:91194cc19bbb | 45 | if (HttpSameStr(pPath, "/net6" )) return DO_NET6_HTML; |
| andrewboyson | 103:91194cc19bbb | 46 | if (HttpSameStr(pPath, "/net6-ajax" )) return DO_NET6_AJAX; |
| andrewboyson | 103:91194cc19bbb | 47 | if (HttpSameStr(pPath, "/log" )) return DO_LOG_HTML; |
| andrewboyson | 103:91194cc19bbb | 48 | if (HttpSameStr(pPath, "/trace" )) return DO_TRACE_HTML; |
| andrewboyson | 103:91194cc19bbb | 49 | if (HttpSameStr(pPath, "/trace-ajax" )) return DO_TRACE_AJAX; |
| andrewboyson | 103:91194cc19bbb | 50 | if (HttpSameStr(pPath, "/fault" )) return DO_FAULT_HTML; |
| andrewboyson | 103:91194cc19bbb | 51 | if (HttpSameStr(pPath, "/firmware" )) return DO_FIRMWARE_HTML; |
| andrewboyson | 103:91194cc19bbb | 52 | if (HttpSameStr(pPath, "/firmware-ajax")) return DO_FIRMWARE_AJAX; |
| andrewboyson | 103:91194cc19bbb | 53 | #ifdef INCLUDE_1_WIRE |
| andrewboyson | 103:91194cc19bbb | 54 | if (HttpSameStr(pPath, "/1wire" )) return DO_1WIRE_HTML; |
| andrewboyson | 103:91194cc19bbb | 55 | if (HttpSameStr(pPath, "/1wire-ajax" )) return DO_1WIRE_AJAX; |
| andrewboyson | 103:91194cc19bbb | 56 | #endif |
| andrewboyson | 103:91194cc19bbb | 57 | |
| andrewboyson | 103:91194cc19bbb | 58 | if (HttpSameStr(pPath, "/favicon.ico" )) return HttpSameDate(WebFaviconDate, WebFaviconTime, pLastModified) ? DO_NOT_MODIFIED : DO_FAVICON; |
| andrewboyson | 103:91194cc19bbb | 59 | if (HttpSameStr(pPath, "/base.css" )) return HttpSameDate(WebBaseCssDate, WebBaseCssTime, pLastModified) ? DO_NOT_MODIFIED : DO_BASE_CSS; |
| andrewboyson | 103:91194cc19bbb | 60 | if (HttpSameStr(pPath, "/settings.css" )) return HttpSameDate(WebNavCssDate, WebNavCssTime, pLastModified) ? DO_NOT_MODIFIED : DO_NAV_CSS; |
| andrewboyson | 103:91194cc19bbb | 61 | if (HttpSameStr(pPath, "/net4.js" )) return HttpSameDate(WebNet4ScriptDate, WebNet4ScriptTime, pLastModified) ? DO_NOT_MODIFIED : DO_NET4_SCRIPT; |
| andrewboyson | 103:91194cc19bbb | 62 | if (HttpSameStr(pPath, "/net6.js" )) return HttpSameDate(WebNet6ScriptDate, WebNet6ScriptTime, pLastModified) ? DO_NOT_MODIFIED : DO_NET6_SCRIPT; |
| andrewboyson | 103:91194cc19bbb | 63 | if (HttpSameStr(pPath, "/trace.js" )) return HttpSameDate(WebTraceScriptDate, WebTraceScriptTime, pLastModified) ? DO_NOT_MODIFIED : DO_TRACE_SCRIPT; |
| andrewboyson | 103:91194cc19bbb | 64 | if (HttpSameStr(pPath, "/clock.js" )) return HttpSameDate(WebClockScriptDate, WebClockScriptTime, pLastModified) ? DO_NOT_MODIFIED : DO_CLOCK_SCRIPT; |
| andrewboyson | 103:91194cc19bbb | 65 | if (HttpSameStr(pPath, "/firmware.js" )) return HttpSameDate(WebFirmwareScriptDate, WebFirmwareScriptTime, pLastModified) ? DO_NOT_MODIFIED : DO_FIRMWARE_SCRIPT; |
| andrewboyson | 103:91194cc19bbb | 66 | #ifdef INCLUDE_1_WIRE |
| andrewboyson | 103:91194cc19bbb | 67 | if (HttpSameStr(pPath, "/1wire.js" )) return HttpSameDate(WebOneWireScriptDate, WebOneWireScriptTime, pLastModified) ? DO_NOT_MODIFIED : DO_1WIRE_SCRIPT; |
| andrewboyson | 103:91194cc19bbb | 68 | #endif |
| andrewboyson | 103:91194cc19bbb | 69 | return WebServerDerivedRequest(pPath, pLastModified); |
| andrewboyson | 103:91194cc19bbb | 70 | } |
| andrewboyson | 103:91194cc19bbb | 71 | static void handleQuery(int todo, char* pQuery) |
| andrewboyson | 103:91194cc19bbb | 72 | { |
| andrewboyson | 103:91194cc19bbb | 73 | switch (todo) |
| andrewboyson | 103:91194cc19bbb | 74 | { |
| andrewboyson | 103:91194cc19bbb | 75 | case DO_LOGIN: WebLoginQuery (pQuery); return; |
| andrewboyson | 103:91194cc19bbb | 76 | case DO_TRACE_AJAX: WebTraceQuery (pQuery); return; |
| andrewboyson | 103:91194cc19bbb | 77 | case DO_CLOCK_AJAX: WebClockQuery (pQuery); return; |
| andrewboyson | 103:91194cc19bbb | 78 | case DO_CLOCK_HTML: WebClockQuery (pQuery); return; |
| andrewboyson | 103:91194cc19bbb | 79 | case DO_LOG_HTML: WebLogQuery (pQuery); return; |
| andrewboyson | 103:91194cc19bbb | 80 | case DO_FAULT_HTML: WebFaultQuery (pQuery); return; |
| andrewboyson | 103:91194cc19bbb | 81 | case DO_FIRMWARE_HTML: WebFirmwareQuery(pQuery); return; |
| andrewboyson | 103:91194cc19bbb | 82 | case DO_FIRMWARE_AJAX: WebFirmwareQuery(pQuery); return; |
| andrewboyson | 103:91194cc19bbb | 83 | #ifdef INCLUDE_1_WIRE |
| andrewboyson | 103:91194cc19bbb | 84 | case DO_1WIRE_HTML: WebOneWireQuery (pQuery); return; |
| andrewboyson | 103:91194cc19bbb | 85 | case DO_1WIRE_AJAX: WebOneWireQuery (pQuery); return; |
| andrewboyson | 103:91194cc19bbb | 86 | #endif |
| andrewboyson | 103:91194cc19bbb | 87 | } |
| andrewboyson | 103:91194cc19bbb | 88 | WebServerDerivedGet(todo, pQuery); |
| andrewboyson | 103:91194cc19bbb | 89 | } |
| andrewboyson | 103:91194cc19bbb | 90 | static bool handlePost(int todo, int contentLength, int contentStart, int size, char* pRequestStream, uint32_t positionInRequestStream) |
| andrewboyson | 103:91194cc19bbb | 91 | { |
| andrewboyson | 103:91194cc19bbb | 92 | switch (todo) |
| andrewboyson | 103:91194cc19bbb | 93 | { |
| andrewboyson | 103:91194cc19bbb | 94 | case DO_FIRMWARE_AJAX: return WebFirmwarePost(contentLength, contentStart, size, pRequestStream, positionInRequestStream); |
| andrewboyson | 103:91194cc19bbb | 95 | } |
| andrewboyson | 103:91194cc19bbb | 96 | return WebServerDerivedPost(todo, contentLength, size, pRequestStream, positionInRequestStream); |
| andrewboyson | 103:91194cc19bbb | 97 | } |
| andrewboyson | 103:91194cc19bbb | 98 | |
| andrewboyson | 103:91194cc19bbb | 99 | static void serverRequest(int size, char* pRequestStream, uint32_t positionInRequestStream, int* pToDo, bool* pPostComplete, uint32_t* pDelayUntil) |
| andrewboyson | 103:91194cc19bbb | 100 | { |
| andrewboyson | 103:91194cc19bbb | 101 | //Handle request for the first packet of data received but leave todo the same after that. |
| andrewboyson | 103:91194cc19bbb | 102 | int contentLength = 0; |
| andrewboyson | 103:91194cc19bbb | 103 | int contentStart = 0; |
| andrewboyson | 103:91194cc19bbb | 104 | if (size && positionInRequestStream == 0) |
| andrewboyson | 103:91194cc19bbb | 105 | { |
| andrewboyson | 103:91194cc19bbb | 106 | //Read the headers |
| andrewboyson | 103:91194cc19bbb | 107 | char* pMethod; |
| andrewboyson | 103:91194cc19bbb | 108 | char* pPath; |
| andrewboyson | 103:91194cc19bbb | 109 | char* pQuery; |
| andrewboyson | 103:91194cc19bbb | 110 | char* pLastModified; |
| andrewboyson | 103:91194cc19bbb | 111 | char* pCookies; |
| andrewboyson | 103:91194cc19bbb | 112 | contentStart = HttpRequestRead(pRequestStream, size, &pMethod, &pPath, &pQuery, &pLastModified, &pCookies, &contentLength); |
| andrewboyson | 103:91194cc19bbb | 113 | |
| andrewboyson | 103:91194cc19bbb | 114 | //Ask the web server what to do |
| andrewboyson | 103:91194cc19bbb | 115 | *pToDo = decideWhatToDoFromPath(pPath, pLastModified); |
| andrewboyson | 103:91194cc19bbb | 116 | |
| andrewboyson | 103:91194cc19bbb | 117 | //If what to do is NOTHING, NOT_FOUND or NOT_MODIFIED then no query or post will be valid so stop now |
| andrewboyson | 103:91194cc19bbb | 118 | if (*pToDo < DO_SERVER) { *pPostComplete = true; return; } |
| andrewboyson | 103:91194cc19bbb | 119 | |
| andrewboyson | 103:91194cc19bbb | 120 | //If what to do is LOGIN then the user has just returned the login form |
| andrewboyson | 103:91194cc19bbb | 121 | if (*pToDo == DO_LOGIN) |
| andrewboyson | 103:91194cc19bbb | 122 | { |
| andrewboyson | 103:91194cc19bbb | 123 | handleQuery(*pToDo, pQuery); //Read the password and the original location |
| andrewboyson | 103:91194cc19bbb | 124 | if (WebLoginQueryPasswordOk) |
| andrewboyson | 103:91194cc19bbb | 125 | { |
| andrewboyson | 103:91194cc19bbb | 126 | if (!WebLoginSessionIdIsSet()) //If there isn't a session id already |
| andrewboyson | 103:91194cc19bbb | 127 | { |
| andrewboyson | 103:91194cc19bbb | 128 | WebLoginSessionIdNew(); //Create a new session id |
| andrewboyson | 103:91194cc19bbb | 129 | } |
| andrewboyson | 103:91194cc19bbb | 130 | *pToDo = WebLoginOriginalToDo; //Load the original todo and SEND_SESSION_ID |
| andrewboyson | 103:91194cc19bbb | 131 | *pToDo += DO_SEND_SESSION_ID; |
| andrewboyson | 103:91194cc19bbb | 132 | } |
| andrewboyson | 103:91194cc19bbb | 133 | *pDelayUntil = MsTimerCount + LOGIN_DELAY_MS; //To prevent brute forcing the hash delay the reply to the login |
| andrewboyson | 103:91194cc19bbb | 134 | *pPostComplete = true; |
| andrewboyson | 103:91194cc19bbb | 135 | return; //Either way no query or post will be valid |
| andrewboyson | 103:91194cc19bbb | 136 | } |
| andrewboyson | 103:91194cc19bbb | 137 | |
| andrewboyson | 103:91194cc19bbb | 138 | //Have a normal request so authenticate |
| andrewboyson | 103:91194cc19bbb | 139 | if (!WebLoginCookiesContainValidSessionId(pCookies)) |
| andrewboyson | 103:91194cc19bbb | 140 | { |
| andrewboyson | 103:91194cc19bbb | 141 | WebLoginOriginalToDo = *pToDo; //Record the original destination for redirection |
| andrewboyson | 103:91194cc19bbb | 142 | *pToDo = DO_LOGIN; |
| andrewboyson | 103:91194cc19bbb | 143 | *pPostComplete = true; |
| andrewboyson | 103:91194cc19bbb | 144 | return; //Ignore any query or post as the user is not authenticated |
| andrewboyson | 103:91194cc19bbb | 145 | } |
| andrewboyson | 103:91194cc19bbb | 146 | |
| andrewboyson | 103:91194cc19bbb | 147 | //Handle the query |
| andrewboyson | 103:91194cc19bbb | 148 | handleQuery(*pToDo, pQuery); |
| andrewboyson | 103:91194cc19bbb | 149 | } |
| andrewboyson | 103:91194cc19bbb | 150 | |
| andrewboyson | 103:91194cc19bbb | 151 | //Do the upload of anything that needs it. Todos it doesn't understand are ignored. |
| andrewboyson | 103:91194cc19bbb | 152 | if (!*pPostComplete) *pPostComplete = handlePost(*pToDo, contentLength, contentStart, size, pRequestStream, positionInRequestStream); |
| andrewboyson | 103:91194cc19bbb | 153 | } |
| andrewboyson | 103:91194cc19bbb | 154 | |
| andrewboyson | 103:91194cc19bbb | 155 | static void serverReply(int todo) |
| andrewboyson | 103:91194cc19bbb | 156 | { |
| andrewboyson | 103:91194cc19bbb | 157 | //Check if todo includes the need to send a cookie |
| andrewboyson | 103:91194cc19bbb | 158 | if (todo >= DO_SEND_SESSION_ID) |
| andrewboyson | 103:91194cc19bbb | 159 | { |
| andrewboyson | 103:91194cc19bbb | 160 | HttpOkCookieName = WebLoginSessionNameGet(); |
| andrewboyson | 103:91194cc19bbb | 161 | HttpOkCookieValue = WebLoginSessionIdGet(); |
| andrewboyson | 103:91194cc19bbb | 162 | HttpOkCookieMaxAge = WebLoginSessionNameLife(); |
| andrewboyson | 103:91194cc19bbb | 163 | todo -= DO_SEND_SESSION_ID; |
| andrewboyson | 103:91194cc19bbb | 164 | } |
| andrewboyson | 103:91194cc19bbb | 165 | else |
| andrewboyson | 103:91194cc19bbb | 166 | { |
| andrewboyson | 103:91194cc19bbb | 167 | HttpOkCookieName = NULL; |
| andrewboyson | 103:91194cc19bbb | 168 | HttpOkCookieValue = NULL; |
| andrewboyson | 103:91194cc19bbb | 169 | HttpOkCookieMaxAge = -1; |
| andrewboyson | 103:91194cc19bbb | 170 | } |
| andrewboyson | 103:91194cc19bbb | 171 | |
| andrewboyson | 103:91194cc19bbb | 172 | //Try all the base modules |
| andrewboyson | 103:91194cc19bbb | 173 | switch (todo) |
| andrewboyson | 103:91194cc19bbb | 174 | { |
| andrewboyson | 103:91194cc19bbb | 175 | case DO_NOT_FOUND: HttpNotFound (); return; |
| andrewboyson | 103:91194cc19bbb | 176 | case DO_NOT_MODIFIED: HttpNotModified (); return; |
| andrewboyson | 103:91194cc19bbb | 177 | case DO_LOGIN: WebLoginHtml (); return; |
| andrewboyson | 103:91194cc19bbb | 178 | case DO_FAVICON: WebFavicon (); return; |
| andrewboyson | 103:91194cc19bbb | 179 | case DO_BASE_CSS: WebBaseCss (); return; |
| andrewboyson | 103:91194cc19bbb | 180 | case DO_NAV_CSS: WebNavCss (); return; |
| andrewboyson | 103:91194cc19bbb | 181 | case DO_TRACE_HTML: WebTraceHtml (); return; |
| andrewboyson | 103:91194cc19bbb | 182 | case DO_TRACE_AJAX: WebTraceAjax (); return; |
| andrewboyson | 103:91194cc19bbb | 183 | case DO_TRACE_SCRIPT: WebTraceScript (); return; |
| andrewboyson | 103:91194cc19bbb | 184 | case DO_CLOCK_HTML: WebClockHtml (); return; |
| andrewboyson | 103:91194cc19bbb | 185 | case DO_CLOCK_AJAX: WebClockAjax (); return; |
| andrewboyson | 103:91194cc19bbb | 186 | case DO_CLOCK_SCRIPT: WebClockScript (); return; |
| andrewboyson | 103:91194cc19bbb | 187 | case DO_NET_HTML: WebNetHtml (); return; |
| andrewboyson | 103:91194cc19bbb | 188 | case DO_NET4_HTML: WebNet4Html (); return; |
| andrewboyson | 103:91194cc19bbb | 189 | case DO_NET4_AJAX: WebNet4Ajax (); return; |
| andrewboyson | 103:91194cc19bbb | 190 | case DO_NET4_SCRIPT: WebNet4Script (); return; |
| andrewboyson | 103:91194cc19bbb | 191 | case DO_NET6_HTML: WebNet6Html (); return; |
| andrewboyson | 103:91194cc19bbb | 192 | case DO_NET6_AJAX: WebNet6Ajax (); return; |
| andrewboyson | 103:91194cc19bbb | 193 | case DO_NET6_SCRIPT: WebNet6Script (); return; |
| andrewboyson | 103:91194cc19bbb | 194 | case DO_LOG_HTML: WebLogHtml (); return; |
| andrewboyson | 103:91194cc19bbb | 195 | case DO_FAULT_HTML: WebFaultHtml (); return; |
| andrewboyson | 103:91194cc19bbb | 196 | case DO_FIRMWARE_HTML: WebFirmwareHtml (); return; |
| andrewboyson | 103:91194cc19bbb | 197 | case DO_FIRMWARE_AJAX: WebFirmwareAjax (); return; |
| andrewboyson | 103:91194cc19bbb | 198 | case DO_FIRMWARE_SCRIPT: WebFirmwareScript(); return; |
| andrewboyson | 103:91194cc19bbb | 199 | #ifdef INCLUDE_1_WIRE |
| andrewboyson | 103:91194cc19bbb | 200 | case DO_1WIRE_HTML: WebOneWireHtml (); return; |
| andrewboyson | 103:91194cc19bbb | 201 | case DO_1WIRE_AJAX: WebOneWireAjax (); return; |
| andrewboyson | 103:91194cc19bbb | 202 | case DO_1WIRE_SCRIPT: WebOneWireScript (); return; |
| andrewboyson | 103:91194cc19bbb | 203 | #endif |
| andrewboyson | 103:91194cc19bbb | 204 | } |
| andrewboyson | 103:91194cc19bbb | 205 | |
| andrewboyson | 103:91194cc19bbb | 206 | //If not called then call the derived (child) module |
| andrewboyson | 103:91194cc19bbb | 207 | WebServerDerivedReply(todo); |
| andrewboyson | 103:91194cc19bbb | 208 | } |
| andrewboyson | 103:91194cc19bbb | 209 | |
| andrewboyson | 103:91194cc19bbb | 210 | int WebServerInit() |
| andrewboyson | 103:91194cc19bbb | 211 | { |
| andrewboyson | 103:91194cc19bbb | 212 | HttpRequestFunction = serverRequest; |
| andrewboyson | 103:91194cc19bbb | 213 | HttpReplyFunction = serverReply; |
| andrewboyson | 103:91194cc19bbb | 214 | |
| andrewboyson | 103:91194cc19bbb | 215 | WebLoginInit(); |
| andrewboyson | 103:91194cc19bbb | 216 | |
| andrewboyson | 103:91194cc19bbb | 217 | return 0; |
| andrewboyson | 103:91194cc19bbb | 218 | } |