Commit 26691968 authored by Per Cederqvist's avatar Per Cederqvist
Browse files

(prot_a_parse_packet): Delete leading and trailing whitespace, to

	avoid having it linger in the input buffer.
parent 122ef817
/*
* $Id: prot-a.c,v 0.80 2003/08/02 20:44:58 ceder Exp $
* $Id: prot-a.c,v 0.81 2003/08/04 11:58:27 ceder Exp $
* Copyright (C) 1991-2002 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -425,6 +425,12 @@ prot_a_parse_packet(Connection *client)
switch(client->parse_pos)
{
case 0: /* Get ref_no */
/* Delete any leading whitespace. This is not strictly
necessary, as prot_a_parse_long will skip whitespace, but
if we don't get a complete packet this will ensure that the
leading whitespace is discarded now. */
prot_a_parse_skip_whitespace(client);
client->ref_no = prot_a_parse_long(client);
client->parse_pos = 1;
/* Fall through */
......@@ -440,6 +446,10 @@ prot_a_parse_packet(Connection *client)
case 2:
/* Call the function that parses the arguments for this call. */
(*fnc_defs[client->function_index].parser)(client);
/* Delete any trailing whitespace. */
prot_a_parse_skip_whitespace(client);
/* Fall through */
default:
client->parse_pos = 0;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment