Re: [PATCH] use arrays in smtpd_request_rec (was Re: smtpd_request_rec questions)

2005-08-15 Thread Rian Hunter
On Aug 14, 2005, at 11:08 PM, Garrett Rooney wrote: Rian Hunter wrote: This patch looks good but I have some questions. You seem to use the returned pointers from apr_array_push without checking if they are NULL. Even in apr_array_push, apr_palloc is used without checking for NULL

smtpd_request_rec questions

2005-08-14 Thread Garrett Rooney
I was just looking at the smtpd_request_rec in mod_smtpd, and I had a few questions. It seems that extensions and rcpt info is being stored in an apr_hash_t, but it's only being keyed by integer. If you're only going to use ints as keys, it seems like an apr_array_header_t would be more

Re: smtpd_request_rec questions

2005-08-14 Thread Rian Hunter
On Aug 14, 2005, at 4:21 PM, Garrett Rooney wrote: I was just looking at the smtpd_request_rec in mod_smtpd, and I had a few questions. It seems that extensions and rcpt info is being stored in an apr_hash_t, but it's only being keyed by integer. If you're only going to use ints as

Re: smtpd_request_rec questions

2005-08-14 Thread Garrett Rooney
Rian Hunter wrote: Ah I didn't even realize the key allocation, I'll fix that. Thanks! The reason I don't use an apr_array_t or similar is that I thought that the number of elements in that type has to be fixed and can't be automatically extended and allocated on the fly, If I'm wrong I

[PATCH] use arrays in smtpd_request_rec (was Re: smtpd_request_rec questions)

2005-08-14 Thread Garrett Rooney
Garrett Rooney wrote: Rian Hunter wrote: Ah I didn't even realize the key allocation, I'll fix that. Thanks! The reason I don't use an apr_array_t or similar is that I thought that the number of elements in that type has to be fixed and can't be automatically extended and allocated on the

Re: [PATCH] use arrays in smtpd_request_rec (was Re: smtpd_request_rec questions)

2005-08-14 Thread Rian Hunter
This patch looks good but I have some questions. You seem to use the returned pointers from apr_array_push without checking if they are NULL. Even in apr_array_push, apr_palloc is used without checking for NULL even though apr_palloc can definitely return NULL. Because of that, I'm not

Re: [PATCH] use arrays in smtpd_request_rec (was Re: smtpd_request_rec questions)

2005-08-14 Thread Garrett Rooney
Rian Hunter wrote: This patch looks good but I have some questions. You seem to use the returned pointers from apr_array_push without checking if they are NULL. Even in apr_array_push, apr_palloc is used without checking for NULL even though apr_palloc can definitely return NULL. Because