Browse Source

set wifi hostname

Thomas Buck 11 months 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
     RUNNING_AS_CLIENT=1
196
     RUNNING_AS_CLIENT=1
197
     DEFAULT_WIFI_SSID="${PICOWOTA_WIFI_SSID}"
197
     DEFAULT_WIFI_SSID="${PICOWOTA_WIFI_SSID}"
198
     DEFAULT_WIFI_PASS="${PICOWOTA_WIFI_PASS}"
198
     DEFAULT_WIFI_PASS="${PICOWOTA_WIFI_PASS}"
199
+    CYW43_HOST_NAME="pico-volcano"
199
     DOCVER="1.0.0.0"
200
     DOCVER="1.0.0.0"
200
 )
201
 )
201
 
202
 

+ 6
- 3
src/http_socket.c View File

253
 }
253
 }
254
 
254
 
255
 static err_t tcp_server_accept(void *arg, struct tcp_pcb *newpcb, err_t err) {
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
     struct SocketCon *Con = arg;
261
     struct SocketCon *Con = arg;
259
     size_t idx = Con->SocketFD;
262
     size_t idx = Con->SocketFD;
260
     if (rb_space(&sock[idx].child_rb) <= 0) {
263
     if (rb_space(&sock[idx].child_rb) <= 0) {
261
         debug("no space for new connection");
264
         debug("no space for new connection");
262
         tcp_abort(newpcb);
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
     rb_push(&sock[idx].child_rb, &newpcb);
271
     rb_push(&sock[idx].child_rb, &newpcb);
269
     return ERR_OK;
272
     return ERR_OK;

Loading…
Cancel
Save