Lines Matching refs:response
182 if (req->internal.response.http_cb && in on_url()
183 req->internal.response.http_cb->on_url) { in on_url()
184 req->internal.response.http_cb->on_url(parser, at, length); in on_url()
197 len = MIN(length, sizeof(req->internal.response.http_status) - 1); in on_status()
198 memcpy(req->internal.response.http_status, at, len); in on_status()
199 req->internal.response.http_status[len] = 0; in on_status()
200 req->internal.response.http_status_code = in on_status()
204 req->internal.response.http_status); in on_status()
206 if (req->internal.response.http_cb && in on_status()
207 req->internal.response.http_cb->on_status) { in on_status()
208 req->internal.response.http_cb->on_status(parser, at, length); in on_status()
225 req->internal.response.cl_present = true; in on_header_field()
230 if (req->internal.response.http_cb && in on_header_field()
231 req->internal.response.http_cb->on_header_field) { in on_header_field()
232 req->internal.response.http_cb->on_header_field(parser, at, in on_header_field()
249 if (req->internal.response.cl_present) { in on_header_value()
261 req->internal.response.content_length = num; in on_header_value()
264 req->internal.response.cl_present = false; in on_header_value()
267 if (req->internal.response.http_cb && in on_header_value()
268 req->internal.response.http_cb->on_header_value) { in on_header_value()
269 req->internal.response.http_cb->on_header_value(parser, at, in on_header_value()
284 req->internal.response.body_found = 1; in on_body()
285 req->internal.response.processed += length; in on_body()
287 NET_DBG("Processed %zd length %zd", req->internal.response.processed, in on_body()
290 if (req->internal.response.http_cb && in on_body()
291 req->internal.response.http_cb->on_body) { in on_body()
292 req->internal.response.http_cb->on_body(parser, at, length); in on_body()
296 if (!req->internal.response.body_frag_start) { in on_body()
297 req->internal.response.body_frag_start = (uint8_t *)at; in on_body()
301 req->internal.response.body_frag_len = req->internal.response.data_len - in on_body()
302 (req->internal.response.body_frag_start - req->internal.response.recv_buf); in on_body()
313 if (req->internal.response.http_cb && in on_headers_complete()
314 req->internal.response.http_cb->on_headers_complete) { in on_headers_complete()
315 req->internal.response.http_cb->on_headers_complete(parser); in on_headers_complete()
324 req->internal.response.content_length > 0) { in on_headers_complete()
340 if (req->internal.response.http_cb && in on_message_begin()
341 req->internal.response.http_cb->on_message_begin) { in on_message_begin()
342 req->internal.response.http_cb->on_message_begin(parser); in on_message_begin()
357 if (req->internal.response.http_cb && in on_message_complete()
358 req->internal.response.http_cb->on_message_complete) { in on_message_complete()
359 req->internal.response.http_cb->on_message_complete(parser); in on_message_complete()
365 req->internal.response.message_complete = 1; in on_message_complete()
376 if (req->internal.response.http_cb && in on_chunk_header()
377 req->internal.response.http_cb->on_chunk_header) { in on_chunk_header()
378 req->internal.response.http_cb->on_chunk_header(parser); in on_chunk_header()
390 if (req->internal.response.http_cb && in on_chunk_complete()
391 req->internal.response.http_cb->on_chunk_complete) { in on_chunk_complete()
392 req->internal.response.http_cb->on_chunk_complete(parser); in on_chunk_complete()
421 if (req->internal.response.cb) { in http_report_null()
426 req->internal.response.http_status_code = 0; in http_report_null()
429 req->internal.response.processed = 0; in http_report_null()
430 req->internal.response.data_len = 0; in http_report_null()
431 req->internal.response.content_length = 0; in http_report_null()
432 req->internal.response.body_frag_start = NULL; in http_report_null()
433 memset(req->internal.response.http_status, 0, HTTP_STATUS_STR_SIZE); in http_report_null()
435 req->internal.response.cb(&req->internal.response, HTTP_DATA_FINAL, in http_report_null()
443 if (req->internal.response.cb) { in http_report_complete()
444 NET_DBG("Calling callback for %zd len data", req->internal.response.data_len); in http_report_complete()
445 req->internal.response.cb(&req->internal.response, HTTP_DATA_FINAL, in http_report_complete()
453 if (req->internal.response.cb) { in http_report_progress()
455 req->internal.response.data_len); in http_report_progress()
457 req->internal.response.cb(&req->internal.response, HTTP_DATA_MORE, in http_report_progress()
494 received = zsock_recv(sock, req->internal.response.recv_buf + offset, in http_wait_data()
495 req->internal.response.recv_buf_len - offset, 0); in http_wait_data()
503 req->internal.response.data_len += received; in http_wait_data()
507 req->internal.response.recv_buf + offset, received); in http_wait_data()
513 if (offset >= req->internal.response.recv_buf_len) { in http_wait_data()
517 if (req->internal.response.message_complete) { in http_wait_data()
524 req->internal.response.data_len = 0; in http_wait_data()
525 req->internal.response.body_frag_start = NULL; in http_wait_data()
526 req->internal.response.body_frag_len = 0; in http_wait_data()
568 if (sock < 0 || req == NULL || req->response == NULL || in http_client_req()
573 memset(&req->internal.response, 0, sizeof(req->internal.response)); in http_client_req()
575 req->internal.response.http_cb = req->http_cb; in http_client_req()
576 req->internal.response.cb = req->response; in http_client_req()
577 req->internal.response.recv_buf = req->recv_buf; in http_client_req()
578 req->internal.response.recv_buf_len = req->recv_buf_len; in http_client_req()