httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Drew Bertola <>
Subject Re: Meaning of len returned by apr_bucket_read()...
Date Fri, 19 Jan 2007 10:24:14 GMT
Giuliano Gavazzi wrote:
>>   apr_bucket_read(b, &str, &len, APR_NONBLOCK_READ);
>> and follow that with:
>>   fprintf(stderr, "strlen(str): %d, len: %d\n", strlen(str), len);
>> I see that strlen(str) and len are not always the same.  Why?
> if the data you read can contain nulls I would expect that. At the
> same time, is it safe to call strlen on it? That is, is the data
> always null terminated?

That's the question.  I didn't mention this, and from your response it
now seems important:  When I compare strlen(str) to len, len is either
equal or less than the length of str.

So, does len truly represent the data read, or does str?


View raw message