Andrew Boyson / net

Dependents:   oldheating gps motorhome heating

Files at this revision

API Documentation at this revision

Comitter:
andrewboyson
Date:
Tue Aug 20 14:49:00 2019 +0000
Parent:
154:ba9879b19d9f
Child:
156:be12b8fd5b21
Commit message:
Changed TcpBuf bytes from char to uint8_t

Changed in this revision

tcp/http/httpshim/httpshim.c Show annotated file Show diff for this revision Revisions of this file
tcp/tcpbuf.c Show annotated file Show diff for this revision Revisions of this file
tcp/tcpbuf.h Show annotated file Show diff for this revision Revisions of this file
tcp/tcpsend.c Show annotated file Show diff for this revision Revisions of this file
--- a/tcp/http/httpshim/httpshim.c	Wed Jul 31 15:10:53 2019 +0000
+++ b/tcp/http/httpshim/httpshim.c	Tue Aug 20 14:49:00 2019 +0000
@@ -13,8 +13,8 @@
 
 void HttpShimRequest(int size, char* pRequestStream, uint32_t positionInRequestStream, char* pWebState, char* pTlsState, bool secure)
 {
-    if (secure) TlsRequest         (pTlsState, pWebState, size, pRequestStream, positionInRequestStream);
-    else        HttpRequestFunction(           pWebState, size, pRequestStream, positionInRequestStream);
+    if (secure) TlsRequest         (pTlsState, pWebState, size, (uint8_t*)pRequestStream, positionInRequestStream);
+    else        HttpRequestFunction(           pWebState, size,           pRequestStream, positionInRequestStream);
 }
 
 static bool tlsRequired;
@@ -24,7 +24,7 @@
     if (tlsRequired) return TlsPoll         (pTlsState, pWebState, clientFinished);
     else             return HttpPollFunction(           pWebState, clientFinished);
 }
-void HttpShimAddChar  (char c)
+void HttpShimAddChar(char c)
 {
     if (tlsRequired) TlsAddChar(c);
     else          TcpBufAddChar(c);
@@ -36,5 +36,6 @@
 }
 bool HttpShimGetTrace()
 {
-    return HttpTrace;
+    if (tlsRequired) return  TlsTrace;
+    else             return HttpTrace;
 }
\ No newline at end of file
--- a/tcp/tcpbuf.c	Wed Jul 31 15:10:53 2019 +0000
+++ b/tcp/tcpbuf.c	Tue Aug 20 14:49:00 2019 +0000
@@ -4,10 +4,10 @@
 static uint32_t currentPositionInMessage;
 static uint32_t bufferPositionInMessage;
 static int bufferLength;
-static char* pBuffer;
-static char* p;
+static uint8_t* pBuffer;
+static uint8_t* p;
 
-void TcpBufStart(uint32_t position, int mss, char *pData)
+void TcpBufStart(uint32_t position, int mss, uint8_t *pData)
 {
     currentPositionInMessage = 0;
     bufferPositionInMessage = position;
@@ -32,3 +32,8 @@
     
     currentPositionInMessage++;
 }
+
+uint8_t* TcpBufGetPointerNext(void)
+{
+    return p;
+}
\ No newline at end of file
--- a/tcp/tcpbuf.h	Wed Jul 31 15:10:53 2019 +0000
+++ b/tcp/tcpbuf.h	Tue Aug 20 14:49:00 2019 +0000
@@ -1,7 +1,8 @@
 #include <stdint.h>
 #include <stdbool.h>
 
-extern void TcpBufStart  (uint32_t position, int mss, char *pData);
-extern void TcpBufAddChar(char c);
-extern int  TcpBufLength (void);
-extern bool TcpBufFilled (void);
\ No newline at end of file
+extern void     TcpBufStart         (uint32_t position, int mss, uint8_t *pData);
+extern void     TcpBufAddChar       (char c);
+extern uint8_t* TcpBufGetPointerNext(void);
+extern int      TcpBufLength        (void);
+extern bool     TcpBufFilled        (void);
\ No newline at end of file
--- a/tcp/tcpsend.c	Wed Jul 31 15:10:53 2019 +0000
+++ b/tcp/tcpsend.c	Tue Aug 20 14:49:00 2019 +0000
@@ -46,7 +46,7 @@
 
 static bool addAppData(int *pDataLength, void* pPacket, uint16_t port, uint32_t start, int mss, char* pAppState, char* pTlsState, bool clientFinished)
 {
-    char* pData = (char*)pPacket + TcpHdrSizeGet();
+    uint8_t* pData = (uint8_t*)pPacket + TcpHdrSizeGet();
     TcpBufStart(start, mss, pData);
     bool finished = false;
     switch (port)