Пример #1
0
void tcp_buffer( TCP_NODE *n, char *buffer, ssize_t bytes ) {
	/* Append buffer */
	node_appendBuffer( n, buffer, bytes );

	if( n->mode != NODE_MODE_READY ) {
		fail( "FIXME tcp_buffer..." );
	}

	/* Overflow? */
	if( n->recv_size >= BUF_OFF1 ) {
		info( &n->c_addr, 500, "Max head buffer exceeded..." );
		node_status( n, NODE_MODE_SHUTDOWN );
		return;
	}

	http_buf( n );
}
Пример #2
0
void tcp_buffer( TCP_NODE *n, char *buffer, ssize_t bytes ) {
	/* Append buffer */
	node_appendBuffer( n, buffer, bytes );

	if( n->pipeline != NODE_READY ) {
		fail( "FIXME tcp_buffer..." );
	}

	/* Overflow? */
	if( n->recv_size >= BUF_OFF1 ) {
		info( &n->c_addr, "Max head buffer exceeded..." );
		node_status( n, NODE_SHUTDOWN );
		return;
	}

	/* Parse request */
	http_buf( n );

	/* Start sending data */
	http_send( n );
}