Lines Matching defs:conn
129 struct connectdata *conn;
153 static CURLcode tftp_connect(struct connectdata *conn, bool *done);
154 static CURLcode tftp_disconnect(struct connectdata *conn,
156 static CURLcode tftp_do(struct connectdata *conn, bool *done);
157 static CURLcode tftp_done(struct connectdata *conn,
159 static CURLcode tftp_setup_connection(struct connectdata * conn);
160 static CURLcode tftp_multi_statemach(struct connectdata *conn, bool *done);
161 static CURLcode tftp_doing(struct connectdata *conn, bool *dophase_done);
162 static int tftp_getsock(struct connectdata *conn, curl_socket_t *socks,
210 timeout_ms = Curl_timeleft(state->conn->data, NULL, start);
214 failf(state->conn->data, "Connection time-out");
265 infof(state->conn->data,
339 struct SessionHandle *data = state->conn->data;
422 struct SessionHandle *data = state->conn->data;
438 struct SessionHandle *data = state->conn->data;
456 struct SessionHandle *data = state->conn->data;
478 state->conn->data->req.upload_fromhere =
490 filename = curl_easy_unescape(data, &state->conn->data->state.path[1], 0,
532 state->conn->ip_addr->ai_addr,
533 state->conn->ip_addr->ai_addrlen);
535 failf(data, "%s", Curl_strerror(state->conn, SOCKERRNO));
562 failf(state->conn->data, "tftp_send_first: internal error");
583 struct SessionHandle *data = state->conn->data;
616 failf(data, "%s", Curl_strerror(state->conn, SOCKERRNO));
641 failf(data, "%s", Curl_strerror(state->conn, SOCKERRNO));
667 failf(data, "%s", Curl_strerror(state->conn, SOCKERRNO));
702 struct SessionHandle *data = state->conn->data;
741 failf(data, "%s", Curl_strerror(state->conn, SOCKERRNO));
762 res = Curl_fillreadbuffer(state->conn, state->blksize, &state->sbytes);
771 failf(data, "%s", Curl_strerror(state->conn, SOCKERRNO));
797 failf(data, "%s", Curl_strerror(state->conn, SOCKERRNO));
889 struct SessionHandle *data = state->conn->data;
922 static CURLcode tftp_disconnect(struct connectdata *conn, bool dead_connection)
924 tftp_state_data_t *state = conn->proto.tftpc;
944 static CURLcode tftp_connect(struct connectdata *conn, bool *done)
952 state = conn->proto.tftpc = calloc(1, sizeof(tftp_state_data_t));
957 if(conn->data->set.tftp_blksize) {
958 blksize = (int)conn->data->set.tftp_blksize;
977 conn->bits.close = TRUE; /* we don't keep TFTP connections up bascially
981 state->conn = conn;
982 state->sockfd = state->conn->sock[FIRSTSOCKET];
989 (unsigned short)(conn->ip_addr->ai_family);
993 if(!conn->bits.bound) {
1008 conn->ip_addr->ai_addrlen);
1010 failf(conn->data, "bind() failed; %s",
1011 Curl_strerror(conn, SOCKERRNO));
1014 conn->bits.bound = TRUE;
1017 Curl_pgrsStartNow(conn->data);
1031 static CURLcode tftp_done(struct connectdata *conn, CURLcode status,
1035 tftp_state_data_t *state = (tftp_state_data_t *)conn->proto.tftpc;
1040 if(Curl_pgrsDone(conn))
1057 static int tftp_getsock(struct connectdata *conn, curl_socket_t *socks,
1063 socks[0] = conn->sock[FIRSTSOCKET];
1075 static CURLcode tftp_receive_packet(struct connectdata *conn)
1080 struct SessionHandle *data = conn->data;
1081 tftp_state_data_t *state = (tftp_state_data_t *)conn->proto.tftpc;
1112 result = Curl_client_write(conn, CLIENTWRITE_BODY,
1144 if(Curl_pgrsUpdate(conn)) {
1159 static long tftp_state_timeout(struct connectdata *conn, tftp_event_t *event)
1162 tftp_state_data_t *state = (tftp_state_data_t *)conn->proto.tftpc;
1169 DEBUGF(infof(conn->data, "timeout: %ld > %ld\n",
1194 static CURLcode tftp_multi_statemach(struct connectdata *conn, bool *done)
1199 struct SessionHandle *data = conn->data;
1200 tftp_state_data_t *state = (tftp_state_data_t *)conn->proto.tftpc;
1201 long timeout_ms = tftp_state_timeout(conn, &event);
1216 Curl_setup_transfer(conn, -1, -1, FALSE, NULL, -1, NULL);
1225 failf(data, "%s", Curl_strerror(conn, error));
1229 result = tftp_receive_packet(conn);
1238 Curl_setup_transfer(conn, -1, -1, FALSE, NULL, -1, NULL);
1253 static CURLcode tftp_doing(struct connectdata *conn, bool *dophase_done)
1256 result = tftp_multi_statemach(conn, dophase_done);
1259 DEBUGF(infof(conn->data, "DO phase is complete\n"));
1265 if(Curl_pgrsUpdate(conn))
1268 result = Curl_speedcheck(conn->data, Curl_tvnow());
1280 static CURLcode tftp_perform(struct connectdata *conn, bool *dophase_done)
1283 tftp_state_data_t *state = (tftp_state_data_t *)conn->proto.tftpc;
1292 tftp_multi_statemach(conn, dophase_done);
1295 DEBUGF(infof(conn->data, "DO phase is complete\n"));
1311 static CURLcode tftp_do(struct connectdata *conn, bool *done)
1318 if(!conn->proto.tftpc) {
1319 code = tftp_connect(conn, done);
1323 state = (tftp_state_data_t *)conn->proto.tftpc;
1325 code = tftp_perform(conn, done);
1336 static CURLcode tftp_setup_connection(struct connectdata * conn)
1338 struct SessionHandle *data = conn->data;
1342 conn->socktype = SOCK_DGRAM; /* UDP datagram based */
1349 type = strstr(conn->host.rawalloc, ";mode=");