forked from Imagelibrary/lwip
Whitespace cleanup in contrib dir
This commit is contained in:
@@ -22,14 +22,14 @@ http_server_netconn_serve(struct netconn *conn)
|
||||
char *buf;
|
||||
u16_t buflen;
|
||||
err_t err;
|
||||
|
||||
/* Read the data from the port, blocking if nothing yet there.
|
||||
|
||||
/* Read the data from the port, blocking if nothing yet there.
|
||||
We assume the request (the part we care about) is in one netbuf */
|
||||
err = netconn_recv(conn, &inbuf);
|
||||
|
||||
|
||||
if (err == ERR_OK) {
|
||||
netbuf_data(inbuf, (void**)&buf, &buflen);
|
||||
|
||||
|
||||
/* Is this an HTTP GET command? (only check the first 5 chars, since
|
||||
there are other formats for GET, and we're keeping it very simple )*/
|
||||
if (buflen>=5 &&
|
||||
@@ -38,20 +38,20 @@ http_server_netconn_serve(struct netconn *conn)
|
||||
buf[2]=='T' &&
|
||||
buf[3]==' ' &&
|
||||
buf[4]=='/' ) {
|
||||
|
||||
/* Send the HTML header
|
||||
|
||||
/* Send the HTML header
|
||||
* subtract 1 from the size, since we dont send the \0 in the string
|
||||
* NETCONN_NOCOPY: our data is const static, so no need to copy it
|
||||
*/
|
||||
netconn_write(conn, http_html_hdr, sizeof(http_html_hdr)-1, NETCONN_NOCOPY);
|
||||
|
||||
|
||||
/* Send our HTML page */
|
||||
netconn_write(conn, http_index_html, sizeof(http_index_html)-1, NETCONN_NOCOPY);
|
||||
}
|
||||
}
|
||||
/* Close the connection (server closes in HTTP) */
|
||||
netconn_close(conn);
|
||||
|
||||
|
||||
/* Delete the buffer (netconn_recv gives us ownership,
|
||||
so we have to make sure to deallocate the buffer) */
|
||||
netbuf_delete(inbuf);
|
||||
@@ -64,7 +64,7 @@ http_server_netconn_thread(void *arg)
|
||||
struct netconn *conn, *newconn;
|
||||
err_t err;
|
||||
LWIP_UNUSED_ARG(arg);
|
||||
|
||||
|
||||
/* Create a new TCP connection handle */
|
||||
/* Bind to port 80 (HTTP) with default IP address */
|
||||
#if LWIP_IPV6
|
||||
@@ -75,10 +75,10 @@ http_server_netconn_thread(void *arg)
|
||||
netconn_bind(conn, IP_ADDR_ANY, 80);
|
||||
#endif /* LWIP_IPV6 */
|
||||
LWIP_ERROR("http_server: invalid conn", (conn != NULL), return;);
|
||||
|
||||
|
||||
/* Put the connection into LISTEN state */
|
||||
netconn_listen(conn);
|
||||
|
||||
|
||||
do {
|
||||
err = netconn_accept(conn, &newconn);
|
||||
if (err == ERR_OK) {
|
||||
|
||||
Reference in New Issue
Block a user