]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
fix tab/space in torgzip.c
authorNick Mathewson <nickm@torproject.org>
Thu, 14 Oct 2004 04:24:42 +0000 (04:24 +0000)
committerNick Mathewson <nickm@torproject.org>
Thu, 14 Oct 2004 04:24:42 +0000 (04:24 +0000)
svn:r2492

src/common/torgzip.c

index b64d5f60f1b0cd529194c9f046bf24fefb21aefe..4bd4381972e34cd4f116d9f705a3eee53d20fee2 100644 (file)
@@ -46,7 +46,7 @@ method_bits(compress_method_t method)
 
 int
 tor_gzip_compress(char **out, size_t *out_len,
-                 const char *in, size_t in_len,
+                  const char *in, size_t in_len,
                   compress_method_t method)
 {
   struct z_stream_s *stream = NULL;
@@ -71,10 +71,10 @@ tor_gzip_compress(char **out, size_t *out_len,
   stream->avail_in = in_len;
 
   if (deflateInit2(stream, Z_BEST_COMPRESSION, Z_DEFLATED,
-                  method_bits(method),
-                  8, Z_DEFAULT_STRATEGY) != Z_OK) {
+                   method_bits(method),
+                   8, Z_DEFAULT_STRATEGY) != Z_OK) {
     log_fn(LOG_WARN, "Error from deflateInit2: %s",
-          stream->msg?stream->msg:"<no message>");
+           stream->msg?stream->msg:"<no message>");
     goto err;
   }
 
@@ -95,12 +95,12 @@ tor_gzip_compress(char **out, size_t *out_len,
         if (stream->avail_out >= stream->avail_in+16)
           break;
       case Z_BUF_ERROR:
-       offset = stream->next_out - ((unsigned char*)*out);
-       out_size *= 2;
-       *out = tor_realloc(*out, out_size);
-       stream->next_out = *out + offset;
-       stream->avail_out = out_size - offset;
-       break;
+        offset = stream->next_out - ((unsigned char*)*out);
+        out_size *= 2;
+        *out = tor_realloc(*out, out_size);
+        stream->next_out = *out + offset;
+        stream->avail_out = out_size - offset;
+        break;
       default:
         log_fn(LOG_WARN, "Gzip compression didn't finish: %s",
                stream->msg ? stream->msg : "<no message>");
@@ -129,7 +129,7 @@ tor_gzip_compress(char **out, size_t *out_len,
 
 int
 tor_gzip_uncompress(char **out, size_t *out_len,
-                   const char *in, size_t in_len,
+                    const char *in, size_t in_len,
                     compress_method_t method)
 {
   struct z_stream_s *stream = NULL;
@@ -156,7 +156,7 @@ tor_gzip_uncompress(char **out, size_t *out_len,
   if (inflateInit2(stream,
                    method_bits(method)) != Z_OK) {
     log_fn(LOG_WARN, "Error from inflateInit2: %s",
-          stream->msg?stream->msg:"<no message>");
+           stream->msg?stream->msg:"<no message>");
     goto err;
   }
 
@@ -171,22 +171,22 @@ tor_gzip_uncompress(char **out, size_t *out_len,
     switch(inflate(stream, Z_FINISH))
       {
       case Z_STREAM_END:
-       goto done;
+        goto done;
       case Z_OK:
-       /* In case zlib doesn't work as I think.... */
-       if (stream->avail_out >= stream->avail_in+16)
-         break;
+        /* In case zlib doesn't work as I think.... */
+        if (stream->avail_out >= stream->avail_in+16)
+          break;
       case Z_BUF_ERROR:
-       offset = stream->next_out - ((unsigned char*)*out);
-       out_size *= 2;
-       *out = tor_realloc(*out, out_size);
-       stream->next_out = *out + offset;
-       stream->avail_out = out_size - offset;
-       break;
+        offset = stream->next_out - ((unsigned char*)*out);
+        out_size *= 2;
+        *out = tor_realloc(*out, out_size);
+        stream->next_out = *out + offset;
+        stream->avail_out = out_size - offset;
+        break;
       default:
-       log_fn(LOG_WARN, "Gzip decompression returned an error: %s",
-              stream->msg ? stream->msg : "<no message>");
-       goto err;
+        log_fn(LOG_WARN, "Gzip decompression returned an error: %s",
+               stream->msg ? stream->msg : "<no message>");
+        goto err;
       }
 
   }