cURL / Mailing Lists / curl-library / Single Mail


Pingpong endofresp() function

From: Steve Holme <>
Date: Sat, 9 Feb 2013 00:53:07 +0000

Hi all,

Whilst I've been working in the email modules for the last 18 months, a
noticed a couple of things around the ping pong end of response function
that I've so far not got round to asking:

1) The definition for this functions is defined in pingpong.h (line 67) as
int (*endofresp)(struct pingpong *pp, int *code). Given that A) We support
bool types and B) The usage of pp->endofresp() in pingping.c (line 398) is
contained within an if statement is there any reason for using an int?

2) Is there any reason we don't pass the line of data and line length to
this function? Instead we pass the pingpong structure down and let the
implementations figure it out themselves even though the call to
Curl_client_write() on line 393 / 394 does this. For example we do the
following instead on line 398 then each function wouldn't have to query
pp->nread_resp(), do strlen(pp-> linestart_resp) or look for the end of the
line character.

if(pp->endofresp(pp->linestart_resp, perline, code))

Many thanks


List admin:
Received on 2013-02-09