<commit_before>package main

import (
	"fmt"
	"io"
	"log"
	"net/http"
	"os"
	"strconv"
)

var maxMb int64 = 1

func receive(w http.ResponseWriter, r *http.Request) {
	fmt.Printf("Received HTTP %s on /\n", r.Method)
	if r.Method != "PUT" {
		fmt.Fprintf(w, "Bad method: %s", r.Method)
		return
	}
	f, err := os.Create("outputfile")
	if err != nil {
		log.Fatalf("failed to open file: %v", err)
	}
	defer f.Close()
	b := make([]byte, maxMb*1024*1024)
	total := 0
	for {
		done := false
		n, err := r.Body.Read(b)
		if err != nil {
			if err == io.EOF {
				done = true
			} else {
				log.Fatalf("failed to read: %v", err)
			}
		}
		total += n
		fmt.Printf("read %d bytes (%d total, EOF=%v)\n", n, total, done)
		n, err = f.Write(b[:n])
		if err != nil {
			log.Fatalf("failed to write: %v", err)
		}
		fmt.Printf("wrote %d bytes\n", n)
		if done {
			break
		}
	}
	fmt.Printf("Received %d bytes from client.\n", total)
	fmt.Fprintf(w, "Received %d bytes. Thanks!\n", total)
}

func main() {
	maxMbEnv := os.Getenv("MAX_BYTES_MB")
	var err error
	maxMb, err = strconv.ParseInt(maxMbEnv, 10, 0)
	if err != nil {
		log.Fatalf("Failed to parse MAX_BYTES_MB: %v", err)
	}
	fmt.Printf("Server accepting max HTTP PUT of %d MB starting..\n", maxMb)
	http.HandleFunc("/", receive)
	if err := http.ListenAndServe(":443", nil); err != nil {
		panic(err)
	}
}<commit_msg>Make ss.go simple again<commit_after>package main

import (
	"fmt"
	"log"
	"net/http"
	"os"
	"strconv"
)

func handle(w http.ResponseWriter, r *http.Request) {
	fmt.Printf("Received HTTP %s request to %s for %v from %s \n", r.Method, r.Host, r.URL, r.RemoteAddr)
	fmt.Fprintf(w, "Thank you and good bye.\n")
}

func main() {
	portEnv := os.Getenv("PORT")
	port, err := strconv.ParseInt(portEnv, 10, 0)
	if err != nil {
		log.Fatalf("Failed to parse PORT: %v", err)
	}
	fmt.Printf("Server registering to any interface on port %d starting..\n", port)
	http.HandleFunc("/", handle)
	if err := http.ListenAndServe(fmt.Sprintf(":%d", port), nil); err != nil {
		panic(err)
	}
}
{'fraction_non_alphanumeric': 0.18217626784835056, 'fraction_numerical': 0.0103397341211226, 'mean_word_length': 3.407809110629067, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, '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': '29631', 'n_tokens_mistral': 877, 'n_tokens_neox': 824, 'n_words': 228}