diff --git a/Platform.cpp b/Platform.cpp index 209b097..0a59695 100644 --- a/Platform.cpp +++ b/Platform.cpp @@ -721,8 +721,8 @@ void Network::Spin() // Read any data that's been received. - if(inputPointer < inputLength) - return; + //if(inputPointer < inputLength) + // return; // Anything new come in? @@ -744,13 +744,20 @@ void Network::ReceiveInput(char* ip, int length) { inputBuffer = ip; inputLength = length; + //reprap.GetPlatform()->Message(HOST_MESSAGE, "Length: "); + //sprintf(scratchString, "%d", inputLength); + //reprap.GetPlatform()->Message(HOST_MESSAGE, scratchString); + //reprap.GetPlatform()->Message(HOST_MESSAGE, "\n"); + reprap.GetPlatform()->Message(HOST_MESSAGE, inputBuffer); inputPointer = 0; } +extern "C" { void RepRapNetworkReceiveInput(char* ip, int length) { reprap.GetPlatform()->GetNetwork()->ReceiveInput(ip, length); } +} void Network::Write(char b) diff --git a/network/httpd.c b/network/httpd.c index 45ff929..f2157c8 100644 --- a/network/httpd.c +++ b/network/httpd.c @@ -231,7 +231,7 @@ static void CloseConnection() } } -static void CloseConnectionAndFreeBuffer() +static void FreeBufferAndCloseConnection() { FreeBuffer(); CloseConnection(); @@ -263,6 +263,8 @@ http_recv(void *arg, struct tcp_pcb *pcb, struct pbuf *p, err_t err) // Deal with data received + RepRapNetworkReceiveInput(data, p->len); + // Free the buffer // Send any data to reply @@ -301,7 +303,7 @@ http_recv(void *arg, struct tcp_pcb *pcb, struct pbuf *p, err_t err) tcp_sent(pcb, http_sent); } else { - CloseConnectionAndFreeBuffer(); + FreeBufferAndCloseConnection(); //pbuf_free(p); //close_conn(pcb, hs); }