aboutsummaryrefslogtreecommitdiffstats
path: root/demos/ARM7-AT91SAM7X-LWIP-GCC/web
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2011-06-06 09:33:47 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2011-06-06 09:33:47 +0000
commited8a14e6880b1ec6f065c6267d4ee86ae1cdb745 (patch)
tree325331c343a5e0c3c9d59161fe3cdc18afb45493 /demos/ARM7-AT91SAM7X-LWIP-GCC/web
parent079f323649c9adcbb49791903f357fb90681628e (diff)
downloadChibiOS-ed8a14e6880b1ec6f065c6267d4ee86ae1cdb745.tar.gz
ChibiOS-ed8a14e6880b1ec6f065c6267d4ee86ae1cdb745.tar.bz2
ChibiOS-ed8a14e6880b1ec6f065c6267d4ee86ae1cdb745.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3031 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'demos/ARM7-AT91SAM7X-LWIP-GCC/web')
-rw-r--r--demos/ARM7-AT91SAM7X-LWIP-GCC/web/web.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/demos/ARM7-AT91SAM7X-LWIP-GCC/web/web.c b/demos/ARM7-AT91SAM7X-LWIP-GCC/web/web.c
index bc8984459..3430fc5b6 100644
--- a/demos/ARM7-AT91SAM7X-LWIP-GCC/web/web.c
+++ b/demos/ARM7-AT91SAM7X-LWIP-GCC/web/web.c
@@ -47,12 +47,13 @@ static void http_server_serve(struct netconn *conn) {
struct netbuf *inbuf;
char *buf;
u16_t buflen;
+ err_t err;
/* Read the data from the port, blocking if nothing yet there.
We assume the request (the part we care about) is in one netbuf */
- inbuf = netconn_recv(conn);
+ err = netconn_recv(conn, &inbuf);
- if (netconn_err(conn) == ERR_OK) {
+ if (err == ERR_OK) {
netbuf_data(inbuf, (void **)&buf, &buflen);
/* Is this an HTTP GET command? (only check the first 5 chars, since
@@ -92,6 +93,7 @@ WORKING_AREA(wa_http_server, WEB_THREAD_STACK_SIZE);
*/
msg_t http_server(void *p) {
struct netconn *conn, *newconn;
+ err_t err;
(void)p;
@@ -109,7 +111,9 @@ msg_t http_server(void *p) {
chThdSetPriority(WEB_THREAD_PRIORITY);
while(1) {
- newconn = netconn_accept(conn);
+ err = netconn_accept(conn, &newconn);
+ if (err != ERR_OK)
+ continue;
http_server_serve(newconn);
netconn_delete(newconn);
}