Lines Matching refs:progress

2747 static zend_bool early_find_sid_in(zval *dest, int where, php_session_rfc1867_progress *progress) /…
2755 …if ((ppid = zend_hash_str_find(Z_ARRVAL(PG(http_globals)[where]), PS(session_name), progress->snam…
2766 static void php_session_rfc1867_early_find_sid(php_session_rfc1867_progress *progress) /* {{{ */
2771 if (early_find_sid_in(&progress->sid, TRACK_VARS_COOKIE, progress)) {
2772 progress->apply_trans_sid = 0;
2780 early_find_sid_in(&progress->sid, TRACK_VARS_GET, progress);
2783 static zend_bool php_check_cancel_upload(php_session_rfc1867_progress *progress) /* {{{ */
2787 …if ((progress_ary = zend_symtable_find(Z_ARRVAL_P(Z_REFVAL(PS(http_session_vars))), progress->key.…
2799 static void php_session_rfc1867_update(php_session_rfc1867_progress *progress, int force_update) /*…
2802 if (Z_LVAL_P(progress->post_bytes_processed) < progress->next_update) {
2811 if (dtv < progress->next_update_time) {
2814 progress->next_update_time = dtv + PS(rfc1867_min_freq);
2817 progress->next_update = Z_LVAL_P(progress->post_bytes_processed) + progress->update_step;
2826 progress->cancel_upload |= php_check_cancel_upload(progress);
2827 Z_TRY_ADDREF(progress->data);
2828 zend_hash_update(Z_ARRVAL_P(sess_var), progress->key.s, &progress->data);
2833 static void php_session_rfc1867_cleanup(php_session_rfc1867_progress *progress) /* {{{ */
2840 zend_hash_del(Z_ARRVAL_P(sess_var), progress->key.s);
2847 php_session_rfc1867_progress *progress;
2857 progress = PS(rfc1867_progress);
2862 progress = ecalloc(1, sizeof(php_session_rfc1867_progress));
2863 progress->content_length = data->content_length;
2864 progress->sname_len = strlen(PS(session_name));
2865 PS(rfc1867_progress) = progress;
2872 if (Z_TYPE(progress->sid) && progress->key.s) {
2886 if (name_len == progress->sname_len && memcmp(data->name, PS(session_name), name_len) == 0) {
2887 zval_dtor(&progress->sid);
2888 ZVAL_STRINGL(&progress->sid, (*data->value), value_len);
2890 smart_str_free(&progress->key);
2891 smart_str_appends(&progress->key, PS(rfc1867_prefix));
2892 smart_str_appendl(&progress->key, *data->value, value_len);
2893 smart_str_0(&progress->key);
2895 progress->apply_trans_sid = APPLY_TRANS_SID;
2896 php_session_rfc1867_early_find_sid(progress);
2906 if (!Z_TYPE(progress->sid) || !progress->key.s) {
2911 if (Z_ISUNDEF(progress->data)) {
2914 progress->update_step = PS(rfc1867_freq);
2916 progress->update_step = progress->content_length * -PS(rfc1867_freq) / 100;
2918 progress->next_update = 0;
2919 progress->next_update_time = 0.0;
2921 array_init(&progress->data);
2922 array_init(&progress->files);
2924 …add_assoc_long_ex(&progress->data, "start_time", sizeof("start_time") - 1, (zend_long)sapi_get_req…
2925 …add_assoc_long_ex(&progress->data, "content_length", sizeof("content_length") - 1, progress->cont…
2926 …add_assoc_long_ex(&progress->data, "bytes_processed", sizeof("bytes_processed") - 1, data->post_by…
2927 add_assoc_bool_ex(&progress->data, "done", sizeof("done") - 1, 0);
2928 add_assoc_zval_ex(&progress->data, "files", sizeof("files") - 1, &progress->files);
2930progress->post_bytes_processed = zend_hash_str_find(Z_ARRVAL(progress->data), "bytes_processed", s…
2933 PS(id) = zend_string_init(Z_STRVAL(progress->sid), Z_STRLEN(progress->sid), 0);
2934 if (progress->apply_trans_sid) {
2942 array_init(&progress->current_file);
2945 add_assoc_string_ex(&progress->current_file, "field_name", sizeof("field_name") - 1, data->name);
2946 add_assoc_string_ex(&progress->current_file, "name", sizeof("name") - 1, *data->filename);
2947 add_assoc_null_ex(&progress->current_file, "tmp_name", sizeof("tmp_name") - 1);
2948 add_assoc_long_ex(&progress->current_file, "error", sizeof("error") - 1, 0);
2950 add_assoc_bool_ex(&progress->current_file, "done", sizeof("done") - 1, 0);
2951 …add_assoc_long_ex(&progress->current_file, "start_time", sizeof("start_time") - 1, (zend_long)time…
2952 add_assoc_long_ex(&progress->current_file, "bytes_processed", sizeof("bytes_processed") - 1, 0);
2954 add_next_index_zval(&progress->files, &progress->current_file);
2956progress->current_file_bytes_processed = zend_hash_str_find(Z_ARRVAL(progress->current_file), "byt…
2958 Z_LVAL_P(progress->current_file_bytes_processed) = data->post_bytes_processed;
2959 php_session_rfc1867_update(progress, 0);
2965 if (!Z_TYPE(progress->sid) || !progress->key.s) {
2969 Z_LVAL_P(progress->current_file_bytes_processed) = data->offset + data->length;
2970 Z_LVAL_P(progress->post_bytes_processed) = data->post_bytes_processed;
2972 php_session_rfc1867_update(progress, 0);
2978 if (!Z_TYPE(progress->sid) || !progress->key.s) {
2983 …add_assoc_string_ex(&progress->current_file, "tmp_name", sizeof("tmp_name") - 1, data->temp_filen…
2986 add_assoc_long_ex(&progress->current_file, "error", sizeof("error") - 1, data->cancel_upload);
2987 add_assoc_bool_ex(&progress->current_file, "done", sizeof("done") - 1, 1);
2989 Z_LVAL_P(progress->post_bytes_processed) = data->post_bytes_processed;
2991 php_session_rfc1867_update(progress, 0);
2997 if (Z_TYPE(progress->sid) && progress->key.s) {
2999 php_session_rfc1867_cleanup(progress);
3001 add_assoc_bool_ex(&progress->data, "done", sizeof("done") - 1, 1);
3002 Z_LVAL_P(progress->post_bytes_processed) = data->post_bytes_processed;
3003 php_session_rfc1867_update(progress, 1);
3008 if (!Z_ISUNDEF(progress->data)) {
3009 zval_ptr_dtor(&progress->data);
3011 zval_ptr_dtor(&progress->sid);
3012 smart_str_free(&progress->key);
3013 efree(progress);
3014 progress = NULL;
3020 if (progress && progress->cancel_upload) {