MCPcopy Create free account
hub / github.com/OpenPrinting/cups / http_content_coding_start

Function http_content_coding_start

cups/http.c:3833–3982  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3831 */
3832
3833static void
3834http_content_coding_start(
3835 http_t *http, /* I - HTTP connection */
3836 const char *value) /* I - Value of Content-Encoding */
3837{
3838 int zerr; /* Error/status */
3839 _http_coding_t coding; /* Content coding value */
3840
3841
3842 DEBUG_printf(("http_content_coding_start(http=%p, value=\"%s\")", (void *)http, value));
3843
3844 if (http->coding != _HTTP_CODING_IDENTITY)
3845 {
3846 DEBUG_printf(("1http_content_coding_start: http->coding already %d.",
3847 http->coding));
3848 return;
3849 }
3850 else if (!strcmp(value, "x-gzip") || !strcmp(value, "gzip"))
3851 {
3852 if (http->state == HTTP_STATE_GET_SEND ||
3853 http->state == HTTP_STATE_POST_SEND)
3854 coding = http->mode == _HTTP_MODE_SERVER ? _HTTP_CODING_GZIP :
3855 _HTTP_CODING_GUNZIP;
3856 else if (http->state == HTTP_STATE_POST_RECV ||
3857 http->state == HTTP_STATE_PUT_RECV)
3858 coding = http->mode == _HTTP_MODE_CLIENT ? _HTTP_CODING_GZIP :
3859 _HTTP_CODING_GUNZIP;
3860 else
3861 {
3862 DEBUG_puts("1http_content_coding_start: Not doing content coding.");
3863 return;
3864 }
3865 }
3866 else if (!strcmp(value, "x-deflate") || !strcmp(value, "deflate"))
3867 {
3868 if (http->state == HTTP_STATE_GET_SEND ||
3869 http->state == HTTP_STATE_POST_SEND)
3870 coding = http->mode == _HTTP_MODE_SERVER ? _HTTP_CODING_DEFLATE :
3871 _HTTP_CODING_INFLATE;
3872 else if (http->state == HTTP_STATE_POST_RECV ||
3873 http->state == HTTP_STATE_PUT_RECV)
3874 coding = http->mode == _HTTP_MODE_CLIENT ? _HTTP_CODING_DEFLATE :
3875 _HTTP_CODING_INFLATE;
3876 else
3877 {
3878 DEBUG_puts("1http_content_coding_start: Not doing content coding.");
3879 return;
3880 }
3881 }
3882 else
3883 {
3884 DEBUG_puts("1http_content_coding_start: Not doing content coding.");
3885 return;
3886 }
3887
3888 switch (coding)
3889 {
3890 case _HTTP_CODING_DEFLATE :

Callers 3

_httpUpdateFunction · 0.85
httpWriteResponseFunction · 0.85
http_add_fieldFunction · 0.85

Calls 1

httpFlushWriteFunction · 0.85

Tested by

no test coverage detected