uvwget: libcurl and libuv master problem #26

Closed
clemensg opened this Issue Jan 25, 2013 · 5 comments

Comments

Projects
None yet
3 participants
@clemensg
Contributor

clemensg commented Jan 25, 2013

Hi, with the current master libuv, I get build errors when compiling uvwget/main.c, because the uv_poll_s struct seems to have changed again. curl_multi_socket_action(curl_handle, req->io_watcher.fd, flags, &running_handles); does not compile.
I tried to exchange the io_watcher.fd part with just socket but after that, it crashed in uv_poll_init_socket during uv__handle_init. So I guess my modification is wrong: curl_multi_socket_action(curl_handle, req->socket, flags, &running_handles);

Once, it was req->fd, then req->io_watcher.fd and now, it does not work anymore, again.

It would be great if somebody could give me a hint on how to adapt the example the right way. Especially on how to access the file descriptor without crashing on Windows. Is there something I forgot, which has to be done, in order to access req->socket ?

Hopefully, someone can shed some light on it. Thank you.

@nikhilm

This comment has been minimized.

Show comment Hide comment
@nikhilm

nikhilm Jan 26, 2013

Owner

@clemensg I tried with the latest master and it compiles and works fine. Are you sure you're on the right branch?

Owner

nikhilm commented Jan 26, 2013

@clemensg I tried with the latest master and it compiles and works fine. Are you sure you're on the right branch?

@clemensg

This comment has been minimized.

Show comment Hide comment
@clemensg

clemensg Jan 26, 2013

Contributor

Yes, I am on master..but:

This uv_poll struct is different, on Unix and Windows systems.
The io_watcher field is only defined here: https://github.com/joyent/libuv/blob/master/include/uv-private/uv-unix.h
But not in here: https://github.com/joyent/libuv/blob/master/include/uv-private/uv-win.h

For my current project, I am working on Windows, maybe this is the problem.. Hopefully, someone can help me out on how to port this to Windows or at least tell me if it's not possible with the current design of libuv.

Contributor

clemensg commented Jan 26, 2013

Yes, I am on master..but:

This uv_poll struct is different, on Unix and Windows systems.
The io_watcher field is only defined here: https://github.com/joyent/libuv/blob/master/include/uv-private/uv-unix.h
But not in here: https://github.com/joyent/libuv/blob/master/include/uv-private/uv-win.h

For my current project, I am working on Windows, maybe this is the problem.. Hopefully, someone can help me out on how to port this to Windows or at least tell me if it's not possible with the current design of libuv.

@saghul

This comment has been minimized.

Show comment Hide comment
@saghul

saghul Jan 26, 2013

You should not use libuv's internal fields, it will probably break again even if you fix it now.

saghul commented Jan 26, 2013

You should not use libuv's internal fields, it will probably break again even if you fix it now.

@nikhilm

This comment has been minimized.

Show comment Hide comment
@nikhilm

nikhilm Jan 26, 2013

Owner

Thanks for pointing out the platform differences.
@clemensg for now you may want to use the approach as in the test - https://github.com/joyent/libuv/blob/master/test/test-poll.c#L49 - of using another wrapper struct.

Owner

nikhilm commented Jan 26, 2013

Thanks for pointing out the platform differences.
@clemensg for now you may want to use the approach as in the test - https://github.com/joyent/libuv/blob/master/test/test-poll.c#L49 - of using another wrapper struct.

@nikhilm

This comment has been minimized.

Show comment Hide comment
@nikhilm

nikhilm Mar 28, 2013

Owner

Fixed by #31

Owner

nikhilm commented Mar 28, 2013

Fixed by #31

@nikhilm nikhilm closed this Mar 28, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment