<commit_before>package com.twitter.finagle.builder

import org.jboss.netty.channel.{Channels, ChannelPipelineFactory}
import org.jboss.netty.handler.codec.http._

import com.twitter.finagle.Codec
import com.twitter.finagle.http._

class Http(compressionLevel: Int = 0) extends Codec[HttpRequest, HttpResponse] {
  val clientPipelineFactory: ChannelPipelineFactory =
    new ChannelPipelineFactory {
      def getPipeline() = {
        val pipeline = Channels.pipeline()
        pipeline.addLast("httpCodec",        new HttpClientCodec())
        pipeline.addLast("httpDechunker",    new HttpChunkAggregator(10<<20))
        pipeline.addLast("httpDecompressor", new HttpContentDecompressor)
        pipeline
      }
    }

  val serverPipelineFactory =
    new ChannelPipelineFactory {
      def getPipeline() = {
        val pipeline = Channels.pipeline()
        pipeline.addLast("httpCodec", new HttpServerCodec)
        if (compressionLevel > 0) {
          pipeline.addLast(
            "httpCompressor",
            new HttpContentCompressor(compressionLevel))<commit_msg>add the HTTP ClientConnetionManager do the default handler stack for HTTP clients.<commit_after>package com.twitter.finagle.builder

import org.jboss.netty.channel.{Channels, ChannelPipelineFactory}
import org.jboss.netty.handler.codec.http._

import com.twitter.finagle.Codec
import com.twitter.finagle.http._

class Http(compressionLevel: Int = 0) extends Codec[HttpRequest, HttpResponse] {
  val clientPipelineFactory: ChannelPipelineFactory =
    new ChannelPipelineFactory {
      def getPipeline() = {
        val pipeline = Channels.pipeline()
        pipeline.addLast("httpCodec",        new HttpClientCodec())
        pipeline.addLast("httpDechunker",    new HttpChunkAggregator(10<<20))
        pipeline.addLast("httpDecompressor", new HttpContentDecompressor)

        pipeline.addLast(
          "connectionLifecycleManager",
          new ClientConnectionManager)

        pipeline
      }
    }

  val serverPipelineFactory =
    new ChannelPipelineFactory {
      def getPipeline() = {
        val pipeline = Channels.pipeline()
        pipeline.addLast("httpCodec", new HttpServerCodec)
        if (compressionLevel > 0) {
          pipeline.addLast(
            "httpCompressor",
            new HttpContentCompressor(compressionLevel))
{'fraction_non_alphanumeric': 0.08798283261802575, 'fraction_numerical': 0.005150214592274678, 'mean_word_length': 3.33271375464684, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4760286', 'n_tokens_mistral': 632, 'n_tokens_neox': 640, 'n_words': 128}