This is the mail archive of the cygwin-apps@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] fix for the proxy port preference not being saved


Brian Dessent wrote:
This is the much-requested fix for the problem of not saving the proxy
port.  I had always expected this was some kind of trivial bug that just
needed a quick fix, but I was incorrect.  It was much more subtle than I
gave it credit for.

Essentially, save_dialog() is called any time a window message is
received that indicates something has changed in the dialog, and the
value is copied from the dialog into local variables.  When setup
terminates, these values are correctly saved to
/etc/setup/last-connection, and properly read upon startup the next
time.

The problem was that when load_dialog() runs to ostensibly restore these
saved values, it first sets the net_proxy_host value - but this causes a
window message to be dispatched, which results in save_dialog() being
called.  Since load_dialog has not yet had a chance to restore the proxy
port setting, save_dialog reads the value of 0 and replaces the value of
net_proxy_host with 0.

Seems simple enough in hindsight, but by the time I realized what was
going on I had been single stepping through disassembly in user32.dll
because I was convinced that the win32 call to SetDlgItemText() was
clobbering adjacent memory locations.  Silly me...


Thankyou! A very nice piece of debugging.
Committed, with the minor tweak of moving the initialization of the new boolean actually happens.


I'm inclined to merge this change over to the release branch and actually release it.

Max.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]