<commit_before>package main

import (
	"crypto/tls"
	"flag"
	"fmt"
	"github.com/oremj/go-simplepush-client/pushclient"
	"log"
	"net/http"
	"strings"
)

var server = flag.String("server", "localhost", "Pushgo Server Name")
var secure = flag.Bool("secure", false, "Use wss/https")
var numClients = flag.Int("clients", 1, "Number of concurrent clients")

type endPoint struct {
	reg     *pushclient.RegisterResponse
	version int
}

func SendPing(endPoint string, version int) (err error) {
	tr := &http.Transport{
		TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
	}
	client := &http.Client{Transport: tr}
	req, err := http.NewRequest("PUT", endPoint, strings.NewReader(fmt.Sprintf("version=%d", version)))
	req.Header.Set("Content-Type", "application/x-www-form-urlencoded")
	if err != nil {
		return
	}
	res, err := client.Do(req)
	res.Body.Close()
	return
}

func RunClient(server string, port int, secure bool, c *Client) {
	pc, err := pushclient.NewClient(server, port, secure, c)
	if err != nil {
		return
	}
	pc.Register()
	go pc.Run()<commit_msg>Fix crash.<commit_after>package main

import (
	"crypto/tls"
	"flag"
	"fmt"
	"github.com/oremj/go-simplepush-client/pushclient"
	"log"
	"net/http"
	"strings"
)

var server = flag.String("server", "localhost", "Pushgo Server Name")
var secure = flag.Bool("secure", false, "Use wss/https")
var numClients = flag.Int("clients", 1, "Number of concurrent clients")

type endPoint struct {
	reg     *pushclient.RegisterResponse
	version int
}

func SendPing(endPoint string, version int) (err error) {
	tr := &http.Transport{
		TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
	}
	client := &http.Client{Transport: tr}
	req, err := http.NewRequest("PUT", endPoint, strings.NewReader(fmt.Sprintf("version=%d", version)))
	req.Header.Set("Content-Type", "application/x-www-form-urlencoded")
	if err != nil {
		return
	}
	res, err := client.Do(req)
	if err == nil {
		res.Body.Close()
	}
	return
}

func RunClient(server string, port int, secure bool, c *Client) {
	pc, err := pushclient.NewClient(server, port, secure, c)
	if err != nil {
		return
	}
	pc.Register()
	go pc.Run()
{'fraction_non_alphanumeric': 0.15777153558052434, 'fraction_numerical': 0.0009363295880149813, 'mean_word_length': 4.623684210526315, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '4481651', 'n_tokens_mistral': 771, 'n_tokens_neox': 761, 'n_words': 187}