<commit_before>/* Copyright (c) 2001, Stanford University
 * All rights reserved
 *
 * See the file LICENSE.txt for information on redistributing this software.
 */

#include "cr_mem.h"
#include "cr_spu.h"
#include "cr_net.h"
#include "cr_url.h"
/*#include "cr_string.h"*/
#include "injectorspu.h"
#include <stdio.h>

extern SPUNamedFunctionTable injector_table[];
InjectorSPU injector_spu;

SPUFunctions injector_functions = {
	NULL, /* CHILD COPY */
	NULL, /* DATA */
	injector_table /* THE ACTUAL FUNCTIONS */
};

int injectorspuReceiveData( CRConnection* conn, void* buf, unsigned int len )
{

	CRMessage *msg = (CRMessage *) buf;

	switch ( msg->header.type ) {
		case CR_MESSAGE_OOB:
			/*injector_spu.oob_count++ ;*/
			crDebug( "injectorspuReceiveData: OOB from conn 0x%x ?", (unsigned int) conn ) ;
			break ;
		default:
			crWarning( "injectorspuReceiveData: Why did I receive message of type 0x%x ?", msg->header.type ) ;
			return 0 ; /* not handled, pass to default handler */
	}

	(void) conn ;
	(void) len ;

	return 1 ; /* handled */
}

void injectorspuConnect( void )
{
	char hostname[4096], protocol[4096] ;
	unsigned short port ;

	crNetInit( injectorspuReceiveData, NULL ) ;

	injector_spu.oob_conn = crAlloc( sizeof(CRConnection*) ) ;
	if ( ! crParseURL( injector_spu.oob_url, protocol, hostname, &port, (unsigned short) INJECTORSPU_OOB_PORT ) )
			crError( "Malformed URL: \"%s\"", injector_spu.oob_url ) ;
	injector_spu.oob_conn = crNetAcceptClient( protocol, (short) port, 32768 /*mtu*/, 0 /*broker*/ ) ;

	/* Initialize the message we send back after every frame */
	injector_spu.info_msg.header.type = CR_MESSAGE_OOB ;<commit_msg>build problem<commit_after>/* Copyright (c) 2001, Stanford University
 * All rights reserved
 *
 * See the file LICENSE.txt for information on redistributing this software.
 */

#include "cr_mem.h"
#include "cr_spu.h"
#include "cr_net.h"
#include "cr_url.h"
/*#include "cr_string.h"*/
#include "injectorspu.h"
#include <stdio.h>

extern SPUNamedFunctionTable injector_table[];
InjectorSPU injector_spu;

SPUFunctions injector_functions = {
	NULL, /* CHILD COPY */
	NULL, /* DATA */
	injector_table /* THE ACTUAL FUNCTIONS */
};

int injectorspuReceiveData( CRConnection* conn, void* buf, unsigned int len )
{

	CRMessage *msg = (CRMessage *) buf;

	switch ( msg->header.type ) {
		case CR_MESSAGE_OOB:
			/*injector_spu.oob_count++ ;*/
			crDebug( "injectorspuReceiveData: OOB from conn %p ?", conn ) ;
			break ;
		default:
			crWarning( "injectorspuReceiveData: Why did I receive message of type 0x%x ?", msg->header.type ) ;
			return 0 ; /* not handled, pass to default handler */
	}

	(void) conn ;
	(void) len ;

	return 1 ; /* handled */
}

void injectorspuConnect( void )
{
	char hostname[4096], protocol[4096] ;
	unsigned short port ;

	crNetInit( injectorspuReceiveData, NULL ) ;

	injector_spu.oob_conn = crAlloc( sizeof(CRConnection*) ) ;
	if ( ! crParseURL( injector_spu.oob_url, protocol, hostname, &port, (unsigned short) INJECTORSPU_OOB_PORT ) )
			crError( "Malformed URL: \"%s\"", injector_spu.oob_url ) ;
	injector_spu.oob_conn = crNetAcceptClient( protocol, (short) port, 32768 /*mtu*/, 0 /*broker*/ ) ;

	/* Initialize the message we send back after every frame */
	injector_spu.info_msg.header.type = CR_MESSAGE_OOB ;
{'fraction_non_alphanumeric': 0.13050075872534142, 'fraction_numerical': 0.013050075872534143, 'mean_word_length': 4.282051282051282, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '1761320', 'n_tokens_mistral': 1249, 'n_tokens_neox': 1165, 'n_words': 305}