<listen> element of the configuration file

Ralf Habacker ralf.habacker at freenet.de
Fri Mar 9 09:41:04 PST 2007


Luigi Paioro schrieb:
> Sure! :-)
>
I've tried to apply this patch on win32 and got problems with it.
Because this patch changes the signature for _dbus_listen_tcp_socket() 
and _dbus_connect_tcp_port() which are used in dbus-sysdeps-win.c too, 
now win32 builds are broken.

Additional I think there is an error in the definition of addr_actual. 
It is declared as uninitialized pointer

+  struct sockaddr_in *addr_actual;

and later used

+  getsockname(listen_fd, (struct sockaddr*) addr_actual, &len);
+  *port = (dbus_uint32_t) ntohs(addr_actual->sin_port);

instead I think it must be

struct sockaddr_in addr_actual;

+  getsockname(listen_fd, (struct sockaddr*) &addr_actual, &len);
+  *port = (dbus_uint32_t) ntohs(addr_actual.sin_port);

Third the addr struct already defined could be reused, no need to add an 
additional structure.


Regards
Ralf

> Luigi
>
> Havoc Pennington wrote:
>> Luigi Paioro wrote:
>>> Well, I think I have a first patch to support "port=0" for UNIX 
>>> systems ("port=any" perhaps in future patch). As far as I have 
>>> tested it works fine... but, please, verify on your machines...
>>>
>>
>> Cool... can you "diff -uNp" instead of using the default diff 
>> options? Then we'll be able to read it a lot better ;-)
>>
>> Havoc
> ------------------------------------------------------------------------
>
> _______________________________________________
> dbus mailing list
> dbus at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dbus
>   



More information about the dbus mailing list