I have done more testing and figured out some more info, I tested with calling the URL using "wget" in several ways.
Normally I would call the url like:
wget "http://192.168.1.1/gainspan/system/config/network" --post-file="test.xml" --header="Content-Type:application/xml"
Where test.xml holds the data I want to post, this only works for one time and the second time the problem as described above occurs, I can call the URL.
However when I don't post any data and execute the command like:
wget "http://192.168.1.1/gainspan/system/config/network" --header="Content-Type:application/xml"
There is no problem at all because no data is posted.
So I stripped my function to bare minimum:
static int32_t process_join( const char* url_parameters, wiced_tcp_stream_t* stream, void* arg, wiced_http_message_body_t* http_message_body )
But this still gives the same issue, when not posting the XML file as POST data it can be called multiple times.
When I call the url with the post data included I can only call the url once and after that it never works again...
Seems like something goes wrong with handling the post data before it arrives to the function.
Does anyone have a pointer on where to look for a solution for me?
I found out I am having the same issue as mentioned here:
This workaround fixes it for me for now...
Glad the work around is working for you at this time.
Will investigate further and fix the problem.
Did you notice how strstr function is used in HTTP server, i.e:
result = wiced_http_server_get_packet_data( socket, packet, &request_string, &request_length );
if ( strstr( request_string, HTTP_HEADER_CLOSE ) != NULL )
The problem is request_string is non-null terminated.