A stack which works with or without an Mbed os library. Provides IPv4 or IPv6 with a full 1500 byte buffer.
Dependents: oldheating gps motorhome heating
Diff: http.cpp
- Revision:
- 4:31fa7d50722c
- Parent:
- 3:ab6fd66d172c
--- a/http.cpp Sat Jan 28 19:10:30 2017 +0000 +++ b/http.cpp Wed Feb 01 07:41:03 2017 +0000 @@ -1,7 +1,10 @@ #include "mbed.h" #include "http.h" #include "time.h" -#include "server.h" + + +int (*HttpRequestFunction)(char *pPath, char *pLastModified); //Plumb into this from your html server +int (*HttpResponseFunction)(int position, int mss, char *pData, int todo); //Plumb into this from your html server static void dateHeaderFromTm(struct tm* ptm, char* ptext) { @@ -100,6 +103,7 @@ } *ppValue = p; //Record the start of the value } + int HttpRequest(int position, int len, char *pData) { char* pMethod; @@ -123,10 +127,10 @@ if (strcmp(pName, "If-Modified-Since") == 0) pLastModified = pValue; } - return ServerRequest(pPath, pLastModified); + return HttpRequestFunction(pPath, pLastModified); } int HttpResponse(int position, int mss, char *pData, int todo) { - return ServerResponse(position, mss, pData, todo); + return HttpResponseFunction(position, mss, pData, todo); }