Lines Matching refs:progress

2573 static zend_bool early_find_sid_in(zval *dest, int where, php_session_rfc1867_progress *progress TS…
2581 …if (zend_hash_find(Z_ARRVAL_P(PG(http_globals)[where]), PS(session_name), progress->sname_len+1, (…
2591 static void php_session_rfc1867_early_find_sid(php_session_rfc1867_progress *progress TSRMLS_DC) /*…
2596 if (early_find_sid_in(&progress->sid, TRACK_VARS_COOKIE, progress TSRMLS_CC)) {
2597 progress->apply_trans_sid = 0;
2605 early_find_sid_in(&progress->sid, TRACK_VARS_GET, progress TSRMLS_CC);
2608 static zend_bool php_check_cancel_upload(php_session_rfc1867_progress *progress TSRMLS_DC) /* {{{ */
2612 …if (zend_symtable_find(Z_ARRVAL_P(PS(http_session_vars)), progress->key.c, progress->key.len+1, (v…
2624 static void php_session_rfc1867_update(php_session_rfc1867_progress *progress, int force_update TSR…
2627 if (Z_LVAL_P(progress->post_bytes_processed) < progress->next_update) {
2636 if (dtv < progress->next_update_time) {
2639 progress->next_update_time = dtv + PS(rfc1867_min_freq);
2642 progress->next_update = Z_LVAL_P(progress->post_bytes_processed) + progress->update_step;
2648 progress->cancel_upload |= php_check_cancel_upload(progress TSRMLS_CC);
2649 …YMBOL_WITH_LENGTH(Z_ARRVAL_P(PS(http_session_vars)), progress->key.c, progress->key.len+1, progres…
2654 static void php_session_rfc1867_cleanup(php_session_rfc1867_progress *progress TSRMLS_DC) /* {{{ */
2659 zend_hash_del(Z_ARRVAL_P(PS(http_session_vars)), progress->key.c, progress->key.len+1);
2666 php_session_rfc1867_progress *progress;
2676 progress = PS(rfc1867_progress);
2681 progress = ecalloc(1, sizeof(php_session_rfc1867_progress));
2682 progress->content_length = data->content_length;
2683 progress->sname_len = strlen(PS(session_name));
2684 PS(rfc1867_progress) = progress;
2691 if (Z_TYPE(progress->sid) && progress->key.c) {
2705 if (name_len == progress->sname_len && memcmp(data->name, PS(session_name), name_len) == 0) {
2706 zval_dtor(&progress->sid);
2707 ZVAL_STRINGL(&progress->sid, (*data->value), value_len, 1);
2710 smart_str_free(&progress->key);
2711 smart_str_appendl(&progress->key, PS(rfc1867_prefix).c, PS(rfc1867_prefix).len);
2712 smart_str_appendl(&progress->key, *data->value, value_len);
2713 smart_str_0(&progress->key);
2715 progress->apply_trans_sid = PS(use_trans_sid);
2716 php_session_rfc1867_early_find_sid(progress TSRMLS_CC);
2726 if (!Z_TYPE(progress->sid) || !progress->key.c) {
2731 if (!progress->data) {
2734 progress->update_step = PS(rfc1867_freq);
2736 progress->update_step = progress->content_length * -PS(rfc1867_freq) / 100;
2738 progress->next_update = 0;
2739 progress->next_update_time = 0.0;
2741 ALLOC_INIT_ZVAL(progress->data);
2742 array_init(progress->data);
2744 ALLOC_INIT_ZVAL(progress->post_bytes_processed);
2745 ZVAL_LONG(progress->post_bytes_processed, data->post_bytes_processed);
2747 ALLOC_INIT_ZVAL(progress->files);
2748 array_init(progress->files);
2750 …add_assoc_long_ex(progress->data, "start_time", sizeof("start_time"), (long)sapi_get_req…
2751 …add_assoc_long_ex(progress->data, "content_length", sizeof("content_length"), progress->content_…
2752 …add_assoc_zval_ex(progress->data, "bytes_processed", sizeof("bytes_processed"), progress->post_byt…
2753 add_assoc_bool_ex(progress->data, "done", sizeof("done"), 0);
2754 … add_assoc_zval_ex(progress->data, "files", sizeof("files"), progress->files);
2757 PS(id) = estrndup(Z_STRVAL(progress->sid), Z_STRLEN(progress->sid));
2758 PS(apply_trans_sid) = progress->apply_trans_sid;
2762 ALLOC_INIT_ZVAL(progress->current_file);
2763 array_init(progress->current_file);
2765 ALLOC_INIT_ZVAL(progress->current_file_bytes_processed);
2766 ZVAL_LONG(progress->current_file_bytes_processed, 0);
2769 …add_assoc_string_ex(progress->current_file, "field_name", sizeof("field_name"), data->name…
2770 …add_assoc_string_ex(progress->current_file, "name", sizeof("name"), *data->fil…
2771 add_assoc_null_ex(progress->current_file, "tmp_name", sizeof("tmp_name"));
2772 add_assoc_long_ex(progress->current_file, "error", sizeof("error"), 0);
2774 add_assoc_bool_ex(progress->current_file, "done", sizeof("done"), 0);
2775 …add_assoc_long_ex(progress->current_file, "start_time", sizeof("start_time"), (long)time…
2776 …add_assoc_zval_ex(progress->current_file, "bytes_processed", sizeof("bytes_processed"), progress->…
2778 add_next_index_zval(progress->files, progress->current_file);
2780 Z_LVAL_P(progress->post_bytes_processed) = data->post_bytes_processed;
2782 php_session_rfc1867_update(progress, 0 TSRMLS_CC);
2788 if (!Z_TYPE(progress->sid) || !progress->key.c) {
2792 Z_LVAL_P(progress->current_file_bytes_processed) = data->offset + data->length;
2793 Z_LVAL_P(progress->post_bytes_processed) = data->post_bytes_processed;
2795 php_session_rfc1867_update(progress, 0 TSRMLS_CC);
2801 if (!Z_TYPE(progress->sid) || !progress->key.c) {
2806 …add_assoc_string_ex(progress->current_file, "tmp_name", sizeof("tmp_name"), data->temp_filename, …
2808 add_assoc_long_ex(progress->current_file, "error", sizeof("error"), data->cancel_upload);
2809 add_assoc_bool_ex(progress->current_file, "done", sizeof("done"), 1);
2811 Z_LVAL_P(progress->post_bytes_processed) = data->post_bytes_processed;
2813 php_session_rfc1867_update(progress, 0 TSRMLS_CC);
2819 if (Z_TYPE(progress->sid) && progress->key.c) {
2821 php_session_rfc1867_cleanup(progress TSRMLS_CC);
2823 add_assoc_bool_ex(progress->data, "done", sizeof("done"), 1);
2824 Z_LVAL_P(progress->post_bytes_processed) = data->post_bytes_processed;
2825 php_session_rfc1867_update(progress, 1 TSRMLS_CC);
2830 if (progress->data) {
2831 zval_ptr_dtor(&progress->data);
2833 zval_dtor(&progress->sid);
2834 smart_str_free(&progress->key);
2835 efree(progress);
2836 progress = NULL;
2842 if (progress && progress->cancel_upload) {