Lines Matching defs:state
86 altcp_proxyconnect_state_free(altcp_proxyconnect_state_t *state)
88 LWIP_ASSERT("state != NULL", state != NULL);
89 mem_free(state);
115 altcp_proxyconnect_state_t *state = (altcp_proxyconnect_state_t *)conn->state;
117 if (!state) {
121 len = altcp_proxyconnect_format_request(NULL, 0, "", state->outer_port);
141 host = ipaddr_ntoa(&state->outer_addr);
142 len2 = altcp_proxyconnect_format_request(buffer, alloc_len, host, state->outer_port);
164 if (conn && conn->state) {
189 altcp_proxyconnect_state_t *state;
203 state = (altcp_proxyconnect_state_t *)conn->state;
205 if (!state) {
213 if (state->flags & ALTCP_PROXYCONNECT_FLAGS_HANDSHAKE_DONE) {
236 state->flags |= ALTCP_PROXYCONNECT_FLAGS_HANDSHAKE_DONE;
256 altcp_proxyconnect_state_t *state = (altcp_proxyconnect_state_t *)conn->state;
259 if (!state || !(state->flags & ALTCP_PROXYCONNECT_FLAGS_HANDSHAKE_DONE)) {
319 altcp_proxyconnect_state_t *state;
326 state = altcp_proxyconnect_state_alloc();
327 if (state == NULL) {
330 state->flags = 0;
331 state->conf = config;
335 conn->state = state;
444 altcp_proxyconnect_state_t *state;
448 state = (altcp_proxyconnect_state_t *)conn->state;
449 if (state == NULL) {
452 if (!(state->flags & ALTCP_PROXYCONNECT_FLAGS_HANDSHAKE_DONE)) {
461 altcp_proxyconnect_state_t *state;
466 state = (altcp_proxyconnect_state_t *)conn->state;
467 if (state == NULL) {
470 if (state->flags & ALTCP_PROXYCONNECT_FLAGS_CONNECT_STARTED) {
473 state->flags |= ALTCP_PROXYCONNECT_FLAGS_CONNECT_STARTED;
477 ip_addr_copy(state->outer_addr, *ipaddr);
478 state->outer_port = port;
480 return altcp_connect(conn->inner_conn, &state->conf->proxy_addr, state->conf->proxy_port, altcp_proxyconnect_lower_connected);
525 altcp_proxyconnect_state_t *state;
533 state = (altcp_proxyconnect_state_t *)conn->state;
534 if (state == NULL) {
538 if (!(state->flags & ALTCP_PROXYCONNECT_FLAGS_HANDSHAKE_DONE)) {
548 /* clean up and free tls state */
550 altcp_proxyconnect_state_t *state = (altcp_proxyconnect_state_t *)conn->state;
551 if (state) {
552 altcp_proxyconnect_state_free(state);
553 conn->state = NULL;