Closed GoogleCodeExporter closed 9 years ago
No, I don't think user pointer is useful anymore.
It was useful before because callbacks could have been added after mg_start().
Now,
1. All configuration should be done before mg_start()
2. There is only one callback, not multiple ones
Original comment by valenok
on 4 Oct 2010 at 10:05
Thanks for the prompt response!
As I am from the old school I don't like global variables for N reasons I'll
not bug you. I'll let my Xmas wish with you, please, add it again! :-)
Original comment by carlos...@gmail.com
on 5 Oct 2010 at 6:51
I made use of the callback user data, and have added it back rather than
refactor to use globals.
Original comment by nbjo...@gmail.com
on 8 Oct 2010 at 7:28
Yes, that's what I did also. I just wanted this to be in the basis, so when
there is an update we don't have to keep doing such changes...
Thanks for the reply!
Carlos.
Original comment by carlos...@gmail.com
on 8 Oct 2010 at 7:58
I completely agree!
Original comment by nbjo...@gmail.com
on 8 Oct 2010 at 9:57
D'oh. Just saw this *after* creating a fork that added a user_pointer.
For the curious, have a look at http://code.google.com/r/ericscouten-mongoose/.
Original comment by eric.sco...@gmail.com
on 19 Oct 2010 at 4:02
Eric, are the link you've provided seems to address different issue.
Original comment by valenok
on 19 Oct 2010 at 6:35
Hmm. It would appear that's a bug in Google Code. I pushed two independent head
revisions to that clone but only the most recent one appears. That is indeed
for a different issue.
I've created a second clone that contains only this patch:
http://code.google.com/r/ericscouten-mongoose2/
Original comment by eric.sco...@gmail.com
on 19 Oct 2010 at 7:12
What about:
1. add "void *user_data" to the mg_start(), i.e.
struct mg_context *mg_start(mg_callback_t callback, void *user_data, const char **options);
2. add "void *user_data" to the struct mg_request_info
Original comment by valenok
on 19 Oct 2010 at 7:29
That is fine with me also. I was trying to maintain compatibility with the
existing mg_start, but this may make more sense.
Shall I roll a new patch?
Original comment by eric.sco...@gmail.com
on 19 Oct 2010 at 7:47
That would be awesome! I was quite frustrated of having a global variable just
because of mongoose.
IMHO the best place to put the user pointer is really on mg_start() and struct
mg_request_info.
If backward compatibility is a problem, just create a "mg_start_ex()" instead,
and macro mg_start(a,b) -> mg_start_ex(a,b,NULL).
Original comment by rodrigo...@gmail.com
on 19 Oct 2010 at 8:02
Revised patch posted at http://code.google.com/r/ericscouten-mongoose2/
Original comment by eric.sco...@gmail.com
on 19 Oct 2010 at 9:30
Looks good to me. I'll integrate that.
If the API changes, I'll bump up the major version number, for all other
releases only minor version number will be increased. So with this change in,
it'll be mongoose 3.0.
Original comment by valenok
on 19 Oct 2010 at 10:03
Submitted
http://code.google.com/p/mongoose/source/detail?r=9061029592953203dfa09eabcba6f1
85996f80a9
Original comment by valenok
on 26 Oct 2010 at 10:39
Original issue reported on code.google.com by
carlos...@gmail.com
on 4 Oct 2010 at 7:50