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
Revision 154:ba9879b19d9f, committed 2019-07-31
- Comitter:
- andrewboyson
- Date:
- Wed Jul 31 15:10:53 2019 +0000
- Parent:
- 153:638c21b06d3e
- Child:
- 155:22f249751106
- Commit message:
- Amalgamated Reply into Poll function
Changed in this revision
--- a/tcp/http/http.c Fri Jul 26 13:51:14 2019 +0000 +++ b/tcp/http/http.c Wed Jul 31 15:10:53 2019 +0000 @@ -6,4 +6,3 @@ //Plumb into these from your html server void (*HttpRequestFunction)(char* pState, int size, char* pRequestStream, uint32_t positionInRequestStream); bool (*HttpPollFunction )(char* pState, bool clientFinished); -bool (*HttpReplyFunction )(char* pState);
--- a/tcp/http/http.h Fri Jul 26 13:51:14 2019 +0000 +++ b/tcp/http/http.h Wed Jul 31 15:10:53 2019 +0000 @@ -49,6 +49,5 @@ #define HTTP_DATE_LENGTH 30 extern void (*HttpRequestFunction)(char* pState, int size, char* pRequestStream, uint32_t positionInRequestStream); -extern int (*HttpPollFunction )(char* pState, bool clientFinished); -extern bool (*HttpReplyFunction )(char* pState); +extern bool (*HttpPollFunction )(char* pState, bool clientFinished);
--- a/tcp/http/httpshim/httpshim.c Fri Jul 26 13:51:14 2019 +0000
+++ b/tcp/http/httpshim/httpshim.c Wed Jul 31 15:10:53 2019 +0000
@@ -24,11 +24,6 @@
if (tlsRequired) return TlsPoll (pTlsState, pWebState, clientFinished);
else return HttpPollFunction( pWebState, clientFinished);
}
-bool HttpShimReply(char* pWebState, char* pTlsState)
-{
- if (tlsRequired) return TlsReply (pTlsState, pWebState);
- else return HttpReplyFunction( pWebState);
-}
void HttpShimAddChar (char c)
{
if (tlsRequired) TlsAddChar(c);
--- a/tcp/http/httpshim/httpshim.h Fri Jul 26 13:51:14 2019 +0000 +++ b/tcp/http/httpshim/httpshim.h Wed Jul 31 15:10:53 2019 +0000 @@ -3,7 +3,6 @@ extern void HttpShimRequest (int size, char* pRequestStream, uint32_t positionInRequestStream, char* pWebState, char* pTlsState, bool secure); extern bool HttpShimPoll (bool clientFinished, char* pWebState, char* pTlsState, bool secure); -extern bool HttpShimReply ( char* pWebState, char* pTlsState); extern void HttpShimAddChar (char c); extern bool HttpShimBufFilled(void); extern bool HttpShimGetTrace (void); \ No newline at end of file
--- a/tcp/tcb.h Fri Jul 26 13:51:14 2019 +0000
+++ b/tcp/tcb.h Wed Jul 31 15:10:53 2019 +0000
@@ -38,7 +38,7 @@
bool appStarted; //Set when data has been sent to the app.
char appData[TCB_APP_STATE_BYTES]; //This is just a place for the app to hold state information - it has no function in TCP.
- char tlsData[TCB_TLS_STATE_BYTES]; //This is just a place for the app to hold state information - it has no function in TCP.
+ char tlsData[TCB_TLS_STATE_BYTES]; //This is just a place for TLS to hold state information - it has no function in TCP.
};
extern uint32_t TcbGetIsn(void);
--- a/tcp/tcpsend.c Fri Jul 26 13:51:14 2019 +0000
+++ b/tcp/tcpsend.c Wed Jul 31 15:10:53 2019 +0000
@@ -46,26 +46,13 @@
static bool addAppData(int *pDataLength, void* pPacket, uint16_t port, uint32_t start, int mss, char* pAppState, char* pTlsState, bool clientFinished)
{
- *pDataLength = 0;
- int todo = 0;
- switch (port)
- {
- case 80: todo = HttpShimPoll(clientFinished, pAppState, pTlsState, false); break;
- case 443: todo = HttpShimPoll(clientFinished, pAppState, pTlsState, true ); break;
- }
- switch (todo)
- {
- case -1: return true;
- case 0: return false;
- case 1: break;
- }
char* pData = (char*)pPacket + TcpHdrSizeGet();
TcpBufStart(start, mss, pData);
bool finished = false;
switch (port)
{
- case 80: finished = HttpShimReply(pAppState, pTlsState); break;
- case 443: finished = HttpShimReply(pAppState, pTlsState); break;
+ case 80: finished = HttpShimPoll(clientFinished, pAppState, pTlsState, false); break;
+ case 443: finished = HttpShimPoll(clientFinished, pAppState, pTlsState, true ); break;
}
*pDataLength = TcpBufLength();
return finished;