diff --git a/myHTTP2022.vcproj b/myHTTP2022.vcproj index dfeb829e6..2f5056582 100644 --- a/myHTTP2022.vcproj +++ b/myHTTP2022.vcproj @@ -163,6 +163,22 @@ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx" UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}" > + + + + + + + @@ -184,7 +200,11 @@ > + + Return to menu";; - +#if WINDOWS +#define os_free free +#define os_malloc malloc +#endif typedef struct http_callback_tag { char *url; @@ -244,10 +247,11 @@ int HTTP_ProcessPacket(const char *recvbuf, char *outbuf, int outBufSize) { char tmpB[64]; char tmpC[64]; int bChanged = 0; + const char *urlStr; *outbuf = '\0'; - const char *urlStr = recvbuf + 5; + urlStr = recvbuf + 5; if(http_startsWith(recvbuf,"GET")) { printf("HTTP request\n"); } else { @@ -258,7 +262,7 @@ int HTTP_ProcessPacket(const char *recvbuf, char *outbuf, int outBufSize) { http_getArg(urlStr,"c",tmpC,sizeof(tmpC)); - for (int i = 0; i < numCallbacks; i++){ + for (i = 0; i < numCallbacks; i++){ char *url = callbacks[i]->url; if (http_checkUrlBase(urlStr, &url[1])){ return callbacks[i]->callback(recvbuf, outbuf, outBufSize); @@ -782,7 +786,11 @@ int HTTP_ProcessPacket(const char *recvbuf, char *outbuf, int outBufSize) { strcat(outbuf,htmlReturnToMenu); strcat(outbuf,htmlEnd); } else if(http_checkUrlBase(urlStr,"ota")) { +#if WINDOWS + +#else otarequest(DEFAULT_OTA_URL); +#endif http_setup(outbuf, httpMimeTypeHTML); strcat(outbuf,htmlHeader); strcat(outbuf,"OTA Requested."); diff --git a/src/win_main.c b/src/win_main.c index 552e179d0..68aa50d72 100644 --- a/src/win_main.c +++ b/src/win_main.c @@ -18,7 +18,7 @@ #define DEFAULT_PORT "80" #include "new_common.h" -#include "new_http.h" +#include "httpserver\new_http.h" #include "new_pins.h" void strcat_safe_test(){