Compression.
Inclusion of 'content-encoding: deflate' header now (really) happens per request, and not "per state" (where any request got this header appended and broke those unaware requests that didn't compress their data.)
This commit is contained in:
parent
95933156a6
commit
69f1863d89
@ -43,10 +43,6 @@ TAL_curl_easy_get (const char *url)
|
||||
curl_easy_setopt (eh,
|
||||
CURLOPT_URL,
|
||||
url));
|
||||
GNUNET_assert (CURLE_OK ==
|
||||
curl_easy_setopt (eh,
|
||||
CURLOPT_ENCODING,
|
||||
"deflate"));
|
||||
GNUNET_assert (CURLE_OK ==
|
||||
curl_easy_setopt (eh,
|
||||
CURLOPT_TCP_FASTOPEN,
|
||||
|
@ -466,12 +466,6 @@ TALER_AUDITOR_connect (struct GNUNET_CURL_Context *ctx,
|
||||
GNUNET_break (GNUNET_OK ==
|
||||
GNUNET_CURL_append_header (ctx,
|
||||
"Expect:"));
|
||||
#if COMPRESS_BODIES
|
||||
/* Tell auditor we compress bodies */
|
||||
GNUNET_break (GNUNET_OK ==
|
||||
GNUNET_CURL_append_header (ctx,
|
||||
"Content-Encoding: deflate"));
|
||||
#endif
|
||||
auditor = GNUNET_new (struct TALER_AUDITOR_Handle);
|
||||
auditor->ctx = ctx;
|
||||
auditor->url = GNUNET_strdup (url);
|
||||
|
@ -40,11 +40,6 @@ TEL_curl_easy_get (const char *url)
|
||||
curl_easy_setopt (eh,
|
||||
CURLOPT_URL,
|
||||
url));
|
||||
GNUNET_assert (CURLE_OK ==
|
||||
curl_easy_setopt (eh,
|
||||
CURLOPT_ENCODING,
|
||||
"deflate"));
|
||||
|
||||
GNUNET_assert (CURLE_OK ==
|
||||
curl_easy_setopt (eh,
|
||||
CURLOPT_FOLLOWLOCATION,
|
||||
|
@ -599,11 +599,11 @@ TALER_EXCHANGE_deposit (struct TALER_EXCHANGE_Handle *exchange,
|
||||
"URL for deposit: `%s'\n",
|
||||
dh->url);
|
||||
ctx = TEAH_handle_to_context (exchange);
|
||||
dh->job = GNUNET_CURL_job_add (ctx,
|
||||
eh,
|
||||
GNUNET_YES,
|
||||
&handle_deposit_finished,
|
||||
dh);
|
||||
dh->job = GNUNET_CURL_job_add2 (ctx,
|
||||
eh,
|
||||
dh->ctx.headers,
|
||||
&handle_deposit_finished,
|
||||
dh);
|
||||
return dh;
|
||||
}
|
||||
|
||||
|
@ -340,11 +340,11 @@ TALER_EXCHANGE_payback (struct TALER_EXCHANGE_Handle *exchange,
|
||||
"URL for payback: `%s'\n",
|
||||
ph->url);
|
||||
ctx = TEAH_handle_to_context (exchange);
|
||||
ph->job = GNUNET_CURL_job_add (ctx,
|
||||
eh,
|
||||
GNUNET_YES,
|
||||
&handle_payback_finished,
|
||||
ph);
|
||||
ph->job = GNUNET_CURL_job_add2 (ctx,
|
||||
eh,
|
||||
ph->ctx.headers,
|
||||
&handle_payback_finished,
|
||||
ph);
|
||||
return ph;
|
||||
}
|
||||
|
||||
|
@ -1221,11 +1221,11 @@ TALER_EXCHANGE_refresh_melt (struct TALER_EXCHANGE_Handle *exchange,
|
||||
}
|
||||
json_decref (melt_obj);
|
||||
ctx = TEAH_handle_to_context (exchange);
|
||||
rmh->job = GNUNET_CURL_job_add (ctx,
|
||||
eh,
|
||||
GNUNET_YES,
|
||||
&handle_refresh_melt_finished,
|
||||
rmh);
|
||||
rmh->job = GNUNET_CURL_job_add2 (ctx,
|
||||
eh,
|
||||
rmh->ctx.headers,
|
||||
&handle_refresh_melt_finished,
|
||||
rmh);
|
||||
return rmh;
|
||||
}
|
||||
|
||||
@ -1651,11 +1651,11 @@ TALER_EXCHANGE_refresh_reveal (struct TALER_EXCHANGE_Handle *exchange,
|
||||
}
|
||||
json_decref (reveal_obj);
|
||||
ctx = TEAH_handle_to_context (rrh->exchange);
|
||||
rrh->job = GNUNET_CURL_job_add (ctx,
|
||||
eh,
|
||||
GNUNET_YES,
|
||||
&handle_refresh_reveal_finished,
|
||||
rrh);
|
||||
rrh->job = GNUNET_CURL_job_add2 (ctx,
|
||||
eh,
|
||||
rrh->ctx.headers,
|
||||
&handle_refresh_reveal_finished,
|
||||
rrh);
|
||||
return rrh;
|
||||
}
|
||||
|
||||
|
@ -386,11 +386,11 @@ refund_obj = json_pack ("{s:o, s:o," /* amount/fee */
|
||||
"URL for refund: `%s'\n",
|
||||
rh->url);
|
||||
ctx = TEAH_handle_to_context (exchange);
|
||||
rh->job = GNUNET_CURL_job_add (ctx,
|
||||
eh,
|
||||
GNUNET_YES,
|
||||
&handle_refund_finished,
|
||||
rh);
|
||||
rh->job = GNUNET_CURL_job_add2 (ctx,
|
||||
eh,
|
||||
rh->ctx.headers,
|
||||
&handle_refund_finished,
|
||||
rh);
|
||||
return rh;
|
||||
}
|
||||
|
||||
|
@ -1044,11 +1044,11 @@ reserve_withdraw_internal (struct TALER_EXCHANGE_Handle *exchange,
|
||||
}
|
||||
json_decref (withdraw_obj);
|
||||
ctx = TEAH_handle_to_context (exchange);
|
||||
wsh->job = GNUNET_CURL_job_add (ctx,
|
||||
eh,
|
||||
GNUNET_YES,
|
||||
&handle_reserve_withdraw_finished,
|
||||
wsh);
|
||||
wsh->job = GNUNET_CURL_job_add2 (ctx,
|
||||
eh,
|
||||
wsh->ctx.headers,
|
||||
&handle_reserve_withdraw_finished,
|
||||
wsh);
|
||||
return wsh;
|
||||
}
|
||||
|
||||
|
@ -337,11 +337,11 @@ TALER_EXCHANGE_track_transaction (struct TALER_EXCHANGE_Handle *exchange,
|
||||
}
|
||||
json_decref (deposit_wtid_obj);
|
||||
ctx = TEAH_handle_to_context (exchange);
|
||||
dwh->job = GNUNET_CURL_job_add (ctx,
|
||||
eh,
|
||||
GNUNET_YES,
|
||||
&handle_deposit_wtid_finished,
|
||||
dwh);
|
||||
dwh->job = GNUNET_CURL_job_add2 (ctx,
|
||||
eh,
|
||||
dwh->ctx.headers,
|
||||
&handle_deposit_wtid_finished,
|
||||
dwh);
|
||||
return dwh;
|
||||
}
|
||||
|
||||
|
@ -85,6 +85,12 @@ TEAH_curl_easy_post (struct TEAH_PostContext *ctx,
|
||||
#else
|
||||
ctx->json_enc = str;
|
||||
#endif
|
||||
|
||||
GNUNET_assert
|
||||
(NULL != (ctx->headers = curl_slist_append
|
||||
(ctx->headers,
|
||||
"Content-Type: application/json")));
|
||||
|
||||
GNUNET_assert (CURLE_OK ==
|
||||
curl_easy_setopt (eh,
|
||||
CURLOPT_POSTFIELDS,
|
||||
|
Loading…
Reference in New Issue
Block a user