Browse Source

set wifi hostname

Thomas Buck 1 year ago
parent
commit
2d3244b0eb
2 changed files with 7 additions and 3 deletions
  1. 1
    0
      CMakeLists.txt
  2. 6
    3
      src/http_socket.c

+ 1
- 0
CMakeLists.txt View File

@@ -196,6 +196,7 @@ target_compile_definitions(gadget PUBLIC
196 196
     RUNNING_AS_CLIENT=1
197 197
     DEFAULT_WIFI_SSID="${PICOWOTA_WIFI_SSID}"
198 198
     DEFAULT_WIFI_PASS="${PICOWOTA_WIFI_PASS}"
199
+    CYW43_HOST_NAME="pico-volcano"
199 200
     DOCVER="1.0.0.0"
200 201
 )
201 202
 

+ 6
- 3
src/http_socket.c View File

@@ -253,17 +253,20 @@ void SocketsCon_Close(struct SocketCon *Con) {
253 253
 }
254 254
 
255 255
 static err_t tcp_server_accept(void *arg, struct tcp_pcb *newpcb, err_t err) {
256
-    (void)err; // TODO?
256
+    if (err != ERR_OK) {
257
+        debug("ignoring failed accept");
258
+        return ERR_OK;
259
+    }
257 260
 
258 261
     struct SocketCon *Con = arg;
259 262
     size_t idx = Con->SocketFD;
260 263
     if (rb_space(&sock[idx].child_rb) <= 0) {
261 264
         debug("no space for new connection");
262 265
         tcp_abort(newpcb);
263
-        return ERR_ABRT;
266
+        return ERR_OK; // ERR_ABRT ?
264 267
     }
265 268
 
266
-    debug("new connection");
269
+    debug("new connection (%d)", err);
267 270
 
268 271
     rb_push(&sock[idx].child_rb, &newpcb);
269 272
     return ERR_OK;

Loading…
Cancel
Save