Jump to content

utorrent works on LINUX!


kraiser

Recommended Posts

  • Replies 241
  • Created
  • Last Reply

Top Posters In This Topic

I believe the default text background color is always white by default in Windows - thus it appears to be a Wine bug... (I could add a call to set the text background color to transparent but I really don't want to add obvious hacks like that in uTorrent...)

Also kokobaroko - the thing where it resets the port to 0 if it is already in use by another app appears to be a Wine bug as well. I've put a workaround in the next uTorrent release but basically getsockname() returns success but either fails to set the port of the passed in struct or sets it to 0 for some reason...

Thanks again :).

Link to comment
Share on other sites

-color

so if you call GetBkColor as a first thing in your app it will always be white under every windows version? and is gray under wine? is that correct?

-SHBrowseForFolder

> ------- Additional Comment #3 From Lei Zhang 2007-05-24 18:08 -------

>The browse for folder dialog porbably just need to be made bigger. I can do this

>in the next couple days. I'm trying to put in the missing "make new folder"

>button anyway.

thats weird, because you can see plenty of gray space, but its his code :), anyway looks like its going to get fixed :)

-port to 0 bug

1 why is that little webserver app able to bind the same port to its socket that is allready allocated for utorrent (under XP SP2)? that sure is weird. is that some M$ 'feature'? the only thing I could find that could cause this was SO_REUSEADDR, but setting this would be umm even more weird :) http.exe binds the port to both localhost and external IP, I didnt check if both http.exe and uttorent see the same traffic, but I suspect that utorrent gets cut of from the network tit.

2 This is how i see it

you set up a socket

you try to bind it, if it fails you display 'network problem, balblabla' and red sign

utorrent calls getsockname

EDIT

>msdn:

>The getsockname function retrieves the current name for the specified socket descriptor in

>name. It is used on the bound or connected socket

but the binding just FAILED and it sure is not connected, so you kinda cant call getsockname?

/EDIT

and auto_schizophrenic part of the code (it knows that binding failed so there is no need to do that) saves sin_port as uTorrent default listening port without checking if "randomize port"/upnp/nat-pmp is set (those are the only options that should make utorrent modify saved listening port, if they are unchecked listening port option is SAINT and should not be touched).

Now the difference between wine and M$ is that M$ doesnt modify the sockaddr structure, and wine zeroes the sin_port if socked is not bound or connected.

I propably got it totally wrong, so please correct me before I storm wine bugzilla :)

Link to comment
Share on other sites

Sorry for the delay kokoborako

> so if you call GetBkColor as a first thing in your app it will always be white under every windows version? and is gray under wine? is that correct?

I'm pretty sure - I'll even note a Windows bible with a link

From Programming Windows, 5th edition (heck, its even in the sample chapter online - it is page 1001 in my hard copy)

http://www.microsoft.com/mspress/books/sampchap/2344.aspx#SampleChapter

"The default background color is white."

don't think it can get much clearer then that....

> thats weird, because you can see plenty of gray space, but its his code, anyway looks like its going to get fixed

Yeah, try to tell him the dialog should resize itself or something if the text is too big - I would think Wine has an internal function or something that does this automatically for its dialogs

> why is that little webserver app able to bind the same port to its socket that is allready allocated for utorrent (under XP SP2)? that sure is weird.

According to my boss this is standard windows behaviour due to SO_REUSEADDR (that the HTTP server must use I guess) and thus is another Wine "bug"

> but the binding just FAILED and it sure is not connected, so you kinda cant call getsockname?

Maybe, but then Wine should return failure or something...

> Now the difference between wine and M$ is that M$ doesnt modify the sockaddr structure,

> and wine zeroes the sin_port if socked is not bound or connected.

I zero it before calling the function - I havn't checked if it actually modifies the structure; so either it doesn't modify it and returns success (which is kind of a ..HUH?) or sets the port to 0 and returns success; which shouldn't happen.

Link to comment
Share on other sites

"The default background color is white."

ok then :)

>> why is that little webserver app able to bind the same port to its socket that is already

>>allocated for utorrent (under XP SP2)? that sure is weird.

>According to my boss this is standard windows behaviour due to SO_REUSEADDR (that the

>HTTP server must use I guess) and thus is another Wine "bug"

Il investigate that, maybe wine doesn't implement SO_REUSEADDR to well, or maybe wine follows unix security model instead of emulating M$ bugs on bugs doctrine :P

Anyway imho uTorrent should use SO_EXCLUSIVEADDRUSE where possible (>=Win2000) to avoid port hijacking (I was so surprised by the http.exe behaviour because i forgot Windows lacks any security and everything is ran as administrator).

EDIT:

ok, pinpointed the little bugger, Windows does fail with 10022 (Invalid argument), Wine happily passes that call, but zeroes the sockaddr structure, time for my Sepuku, Im sorry for all the commotion.

My testcase: setup socket, bitd it, getsockname, setup another with same port, try to bind, getsockname.

windows

sock.c:1658:getsockname returned : 33403, should be 33403

sock.c:1672:Binding second socket failed as expected, thats good: 10048

sock.c:1676:Failed to call getsockname: 10022

sock.c:1677:getsockname returned : 33403, should be 33403

wine

sock.c:1658:getsockname returned : 33403, should be 33403

sock.c:1672:Binding second socket failed as expected, thats good: 10048

sock.c:1684:getsockname returned : 0, should be 33403

anyway im glad thats fixed now (I wonder how, do you check for "randomize port"/upnp/nat-pmp options?)

Edit: nope, you fixed it half way :P running speed guide (clicking network status icon or from Options) will still overwrite the port to 0.

I just submitted

http://bugs.winehq.org/show_bug.cgi?id=8513 not important for utorrent

http://bugs.winehq.org/show_bug.cgi?id=8514 if resolved will let you use getsockname, but i still think calling it when one of 3 "ask OS for port" options are not set is a waste of time

Btw why did you change that part of the code in build 1170? Maybe it was by accident while fighting with uPNP?

Edit: Found cosmetic bug, uTorrent taskbar Icon is not displayed under Wine, wine displays generic white box instead of uTorrent green one (or main.ico if present).

Disregard the rest of my babbling after this line :(

---------------------------GARBAGE-------------------------------------------

>> but the binding just FAILED and it sure is not connected, so you kinda cant call

>getsockname?

>Maybe, but then Wine should return failure or something...

Why? Windows doesn't

EDIT:

ok, pinpointed the little bugger, Windows does fail with 10022 (Invalid argument), Wine happily passes that call, but zeroes the sockaddr structure, time for my Sepuku

/ETIT

and MSDN says this call can be made only on connected or bound sockets. It probably is a wine bug as in "we forgot to emulate every stupid thing M$ does that's not documented" :)

>msdn:

>The getsockname function retrieves the current name for the specified socket descriptor in

>name. It is used on the bound or connected socket

'but the binding just FAILED and it sure is not connected, so you kinda cant call getsockname', MSDN says you can call getsockname only on "bound or connected socket", and you do it regardless of the outcome of binding (I'm just guessing here, too lazy to run debugger).

Why do you call getsockname at all? to get the actual allocated port number? then it should be called only when "randomize port"/upnp/nat-pmp is set. I would hardly call that a wine hack :), you dont need to ask the OS what port it allocated if you didn't ask it to choose it for you.

>> Now the difference between wine and M$ is that M$ doesn't modify the sockaddr structure,

>> and wine zeroes the sin_port if socked is not bound or connected.

>I zero it before calling the function

and since the socket is not bound to any port (binding failed = red icon) you cant expect deterministic behavior. It can be one of those stupid M$ "compatibility features" (read - bugs) where it acts like everything is pink with rainbows and unicorns when actually it should return an error or do nothing.

> - I haven't checked if it actually modifies the structure; so either it doesn't modify it and

>returns success (which is kind of a ..HUH?) or sets the port to 0 and returns success; which

>shouldn't happen.

or does what MSDN says = ignores this call completely because it can be made only on sockets that already have port allocated? :)

Link to comment
Share on other sites

  • 4 weeks later...
Looks like latest release of WINE (0.9.11) fails to start uTorrent with the following error:

Code:

err:ntdll:RtlpWaitForCriticalSection section 0x73d80020 "heap.c: main process heap section" wait timed out in thread 000a, blocked by 0009, retrying (60 sec)

err:seh:raise_exception Unhandled exception code c0000194 flags 0 addr 0x3e9224ec

I'm going to try the latest nightly next, failing that I'll drop back to 0.9.10 and try the patch manually.

I have the same problem, but the problem is that utorrent works on my box 3-4 months, but today I had an outage, and now it won't start with this error.

I don't know what should I do.

I have deleted the .wine folder, I have put a new user to the box and copy to the folder the wine-0.9.29 version as earlier, but it wont work, I tried with new utorrent, but the same error message.

Is there something on the box, what should be deleted?

I had 3 users, and can't get to work properly.

Even not to started.

Link to comment
Share on other sites

The problem is not with the version.

It has been working for 3-4 months, I have a problem somewhere on the box global.

I guess, because before the outage/shutdown/reboot everythings works fine.

(Now I am on the way to compile the newest version, but I think this wont solve this)

____

edited:

Now I have the version 0.9.39, and I get the following error:

http://pastebin.ca/578960

err:ntdll:RtlpWaitForCriticalSection section 0x60301760 "rtl.c: peb_lock" wait timed out in thread 000a, blocked by 0009

Link to comment
Share on other sites

kokobaroko, if you've interested, here's the latest WINE stuff.

1) Icon in Taskbar notification area (sometimes called the systray) doesn't work with our icon. You can use a resource hacker-type application to easily see what icon formats we provide - but it stopped working since we added a 256x256 compressed vista png icon.

2) WINE doesn't correctly handle WM_PAINT and/or WM_ERASEBKGND from its list controls - I havn't spent hours testing to determine which, but it gets a black background (you can see this if you set it not use emulate XP or higher with the most recent 1.7 beta)

Link to comment
Share on other sites

icon : http://bugs.winehq.org/show_bug.cgi?id=3370

patch inside fixes lack of icon in window manager caption and task bar

WM_ERASEBKGND: http://bugs.winehq.org/show_bug.cgi?id=8802

there are lots of bugs concerning WM_ERASEBKGND in wine, but I wasnt able to find similar one, so new bug report.

now im hunting tray icon, maybe its resize code.

Link to comment
Share on other sites

now you tell me? :/ :)))

so what do you use on XP that works?

ps: I just opened utorrent in PE Explorer 1.99 and it says icons 5 thru 8 are damaged .. on the other hand version 1.97 opens them fine.

I can confirm that deleting Vista icon from the resource list makes wine load icon number 4 and all is fine, so maybe wine doesnt support vista png icons? blah, Do anyone know any small freeware shit with vista tray icon so i can test it in wine?

Link to comment
Share on other sites

> so what do you use on XP that works?

XP and above support a special window flag for their listviews that reduces the flicker so I don't have to do it manually.

> blah, Do anyone know any small freeware shit with vista tray icon so i can test it in wine?

Hmmm... I still havn't seen a whole lot of apps with vista icons yet. I gather it has something to do with Microsoft's latest stable development environment still not supporting vista icons out of the box. If it works, I'd try something lke Windows Live Mail

http://get.live.com/betas/maildesktop_betas

also, I can send you an icon to test with as well that has most icon formats (we don't do this in uTorrent as it increases executable size by quite a bit).

Link to comment
Share on other sites

>XP and above support a special window flag for their listviews that reduces the flicker so I

>don't have to do it manually.

and this flag name is? please details details, googling flicker style flag gave me WS_CLIPCHILDREN, but thats for resizing and can be used on all windows , so hmm WS_EX_COMPOSITE ?

>vista icons

how does app decide which icon to load?

Link to comment
Share on other sites

> and this flag name is? please details details, googling flicker style flag gave me

> WS_CLIPCHILDREN, but thats for resizing and can be used on all windows , so hmm

> WS_EX_COMPOSITE ?

LVS_EX_DOUBLEBUFFER

> how does app decide which icon to load?

uTorrent doesn't - windows/WINE chooses which icon in the icon group to load.

Link to comment
Share on other sites

Ultima's thing is MFS_DEFAULT - from msdn

"MFS_DEFAULT

Specifies that the menu item is the default. A menu can contain only one default menu item, which is displayed in bold."

Also, I figured out the checkboxes on the messageboxes don't work. What's worse is that the checkboxes always seem to return false or something because it never shows the dialogs again.

Basically, I subclass the messagebox and move some its controls around, but Wine's Messagebox is doing something wrong I guess.

Link to comment
Share on other sites

For me, all releases since 2585 are not working, under wine 0.9.39 Debian Etch.

It seems to be the same behaviour that was broken after 2151 and fixed for 2585. All connections are timing out rather than completing the handshake or at least that's what it looks like when I log peer traffic.

Link to comment
Share on other sites

>Wine doesn't show the bolding properly for the default delete action when you right-click the

>Delete button.

right-click the Delete button? what delete button? i dont understand. Thers the Remove button, but why would i want to right click it?

Edit : I just tried and now know what you mean :)

>Also, I figured out the checkboxes on the messageboxes don't work. What's worse is that the

>checkboxes always seem to return false or something because it never shows the dialogs

>again.

>Basically, I subclass the messagebox and move some its controls around, but Wine's

>Messagebox is doing something wrong I guess.

I have to run windows to look for those messageboxes, because I dont even know where should they be :) edit: i mean checkboxes

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

Guest
This topic is now closed to further replies.

×
×
  • Create New...