2395 unsigned bytes_left;
2413 DLOG ( 2, (
"CAS: Parsing %d(decimal) bytes\n", recv->cnt ) );
2423 if ( bytes_left <
sizeof(*mp) ) {
2438 if ( bytes_left <
sizeof(*mp) + 2 *
sizeof(*pLW) ) {
2443 msg.
m_count = ntohl ( pLW[1] );
2444 msgsize = msg.
m_postsize +
sizeof(*mp) + 2 *
sizeof ( *pLW );
2445 pBody = (
void * ) ( pLW + 2 );
2449 pBody = (
void * ) ( mp + 1 );
2454 if (client->
proto==IPPROTO_TCP) {
2462 log_header (
"CAS: Client version too old",
2463 client, &msg, 0, nmsg );
2478 if ( msgsize & 0x7 ) {
2479 if (client->
proto==IPPROTO_TCP) {
2482 "CAS: Missaligned protocol rejected" );
2484 log_header (
"CAS: Missaligned protocol rejected",
2485 client, &msg, 0, nmsg );
2500 if (client->
proto==IPPROTO_TCP) {
2503 "CAS: Server unable to load large request message. Max bytes=%lu",
2506 log_header (
"CAS: server unable to load large request message",
2507 client, &msg, 0, nmsg );
2510 assert ( msgsize >= bytes_left );
2521 if ( msgsize > bytes_left ) {
2529 log_header (
NULL, client, &msg, pBody, nmsg);
2531 if ( client->
proto==IPPROTO_UDP ) {
2533 status = ( *udpJumpTable[msg.
m_cmmd] )( &msg, pBody, client );
2540 status = bad_udp_cmd_action ( &msg, pBody, client );
2546 status = ( *tcpJumpTable[msg.
m_cmmd] ) ( &msg, pBody, client );
2553 return bad_tcp_cmd_action ( &msg, pBody, client );
struct message_buffer recv
#define assert(exp)
Declare that a condition should be true.
void casExpandRecvBuffer(struct client *pClient, ca_uint32_t size)
#define SEND_UNLOCK(CLIENT)
unsigned recvBytesToDrain
GLBLTYPE BUCKET * pCaBucket
GLBLTYPE unsigned rsrvSizeofLargeBufTCP
#define DLOG(LEVEL, ARGSINPAREN)
#define CA_VSUPPORTED(MINOR)
unsigned minor_version_number
#define SEND_LOCK(CLIENT)