Tcl Source Code

Check-in [3989ecbba9]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Workaround for [socket -server foo -myaddr localhost 0] failure on OSX.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 3989ecbba9ea7e1a0040ca316d2cd079ffecb342
User & Date: max 2012-09-26 21:02:33
Original Comment: Work aroun for [socket -server foo -myaddr localhost 0] failure on OSX.
Context
2012-10-03
15:39
When checking for std channels being closed, compare the channel state, not the channel itself so th... check-in: 986eb391ad user: dgp tags: trunk
08:11
merge trunk check-in: 46dc221942 user: dkf tags: tip-400-impl
2012-10-02
16:08
Fix for core bug yet to be named/numbered. Closed-Leaf check-in: ba0663c73f user: dgp tags: dgp-stackedstdchan
2012-09-26
21:02
Workaround for [socket -server foo -myaddr localhost 0] failure on OSX. check-in: 3989ecbba9 user: max tags: trunk
2012-09-23
20:29
eliminate unnecessary TEXT() macros check-in: c155794425 user: jan.nijtmans tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to ChangeLog.







1
2
3
4
5
6
7






2012-09-20  Jan Nijtmans  <[email protected]>

	* win/configure.in: New import libraries for zlib 1.2.7,
	* win/configure:    usable for all win32/win64 compilers
	* compat/zlib/win32/zdll.lib
	* compat/zlib/win64/zdll.lib

>
>
>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
2012-09-26  Reinhard Max  <[email protected]>

	* generic/tclIOSock.c (TclCreateSocketAddress): Work around a bug
	in getaddrinfo() on OSX that caused name resolution to fail for
	[socket -server foo -myaddr localhost 0].

2012-09-20  Jan Nijtmans  <[email protected]>

	* win/configure.in: New import libraries for zlib 1.2.7,
	* win/configure:    usable for all win32/win64 compilers
	* compat/zlib/win32/zdll.lib
	* compat/zlib/win64/zdll.lib

Changes to generic/tclIOSock.c.

147
148
149
150
151
152
153
154
155
156
157
158
159
160
161








162



163
164
165
166
167
168
169
    const char **errorMsgPtr)		/* Place to store the error message
					 * detail, if available. */
{
    struct addrinfo hints;
    struct addrinfo *p;
    struct addrinfo *v4head = NULL, *v4ptr = NULL;
    struct addrinfo *v6head = NULL, *v6ptr = NULL;
    char *native = NULL, portstring[TCL_INTEGER_SPACE];
    const char *family = NULL;
    Tcl_DString ds;
    int result, i;

    if (host != NULL) {
	native = Tcl_UtfToExternalDString(NULL, host, -1, &ds);
    }








    TclFormatInt(portstring, port);



    (void) memset(&hints, 0, sizeof(hints));
    hints.ai_family = AF_UNSPEC;

    /* 
     * Magic variable to enforce a certain address family - to be superseded
     * by a TIP that adds explicit switches to [socket]
     */







|







>
>
>
>
>
>
>
>
|
>
>
>







147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
    const char **errorMsgPtr)		/* Place to store the error message
					 * detail, if available. */
{
    struct addrinfo hints;
    struct addrinfo *p;
    struct addrinfo *v4head = NULL, *v4ptr = NULL;
    struct addrinfo *v6head = NULL, *v6ptr = NULL;
    char *native = NULL, portbuf[TCL_INTEGER_SPACE], *portstring;
    const char *family = NULL;
    Tcl_DString ds;
    int result, i;

    if (host != NULL) {
	native = Tcl_UtfToExternalDString(NULL, host, -1, &ds);
    }

    /*
     * Workaround for OSX's apparent inability to resolve "localhost", "0"
     * when the loopback device is the only available network interface.
     */
    if (host != NULL && port == 0) {
        portstring = NULL;
    } else {
        TclFormatInt(portbuf, port);
        portstring = portbuf;
    }
    
    (void) memset(&hints, 0, sizeof(hints));
    hints.ai_family = AF_UNSPEC;

    /* 
     * Magic variable to enforce a certain address family - to be superseded
     * by a TIP that adds explicit switches to [socket]
     */