+ if (len > 0) {
+ int i;
+ char *fcomp= NULL;
+ char *fdecomp = NULL;
+ char *command = NULL;
+
+ switch (header.content_encoding) {
+ case encoding_plain_e:
+ break;
+
+ case encoding_gzip_e:
+ fcomp = tempname (conf->temp, ".gz");
+ writefile (fcomp, body, len);
+ command = createcommand ("gunzip %s", fcomp);
+ system (command);
+ fdecomp = strdup (fcomp);
+ for (i = strlen (fdecomp) - 1; i > 0; i--) {
+ if (fdecomp[i] == '.') {
+ fdecomp[i] = 0;
+ break;
+ }
+ }
+ len = readfile (&newbody, fdecomp);
+ break;
+
+ case encoding_compress_e:
+ fcomp = tempname (conf->temp, ".Z");
+ writefile (fcomp, body, len);
+ command = createcommand ("compress %s", fcomp);
+ system (command);
+ fdecomp = strdup (fcomp);
+ for (i = strlen (fdecomp) - 1; i > 0; i--) {
+ if (fdecomp[i] == '.') {
+ fdecomp[i] = 0;
+ break;
+ }
+ }
+ len = readfile (&newbody, fdecomp);
+ break;
+ }
+
+ if (fcomp) {
+ unlink (fcomp);
+ free (fcomp);
+ }
+ if (fdecomp) {
+ unlink (fdecomp);
+ free (fdecomp);
+ }
+ if (command) {
+ free (command);
+ }
+ }