Changeset 389 for branches/thune/thread_safe/net.c
- Timestamp:
- 05/17/07 16:58:46 (18 months ago)
- Files:
-
- 1 modified
-
branches/thune/thread_safe/net.c (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/thune/thread_safe/net.c
r378 r389 115 115 116 116 if( ! _makeAddrName( (struct sockaddr_in*) addr->ptr.v, 117 ur_cstring( hc), ur_int(tos) ) )117 ur_cstring(ut,hc), ur_int(tos) ) ) 118 118 { 119 119 ur_throwErr( UR_ERR_SCRIPT, "gethostbyname failed" ); … … 128 128 129 129 130 static int _openUdpSocket( UThread* u r_thread, int port, int block )130 static int _openUdpSocket( UThread* ut, int port, int block ) 131 131 { 132 132 struct sockaddr_in my_addr; … … 180 180 -1 Url handled, but error occured. 181 181 */ 182 static int _netOpen( UPortDevice* dev, UThread* u r_thread, UCell* tos )182 static int _netOpen( UPortDevice* dev, UThread* ut, UCell* tos ) 183 183 { 184 184 int port; … … 196 196 if( ! ur_isAWord(res) ) 197 197 return 0; 198 if( ur_atom(res) != UR_INTERN("udp", 3) )198 if( ur_atom(res) != ur_intern("udp", 3) ) 199 199 return 0; 200 200 … … 232 232 } 233 233 234 if( ! _makeAddrName( &addr, ur_cstring( spec), hostPort ) )234 if( ! _makeAddrName( &addr, ur_cstring(ut,spec), hostPort ) ) 235 235 { 236 236 ur_throwErr( UR_ERR_ACCESS, "gethostbyname failed" ); … … 244 244 int block = 1; 245 245 246 if( ! ur_userAllows( u r_thread, "Open socket on port %d", port ) )246 if( ! ur_userAllows( ut, "Open socket on port %d", port ) ) 247 247 { 248 248 ur_throwErr( UR_ERR_ACCESS, "User denied open" ); … … 250 250 } 251 251 252 socket = _openUdpSocket( u r_thread, port, block );252 socket = _openUdpSocket( ut, port, block ); 253 253 if( socket < 0 ) 254 254 return -1; 255 255 256 val = ur_makePort( dev, res );256 val = ur_makePort( ut, dev, res ); 257 257 if( val ) 258 258 { … … 390 390 if( ur_is(val, UT_INT) ) 391 391 { 392 if( ! ur_stringSlice( tos, &buf, &end ) )392 if( ! ur_stringSlice( ut, tos, &buf, &end ) ) 393 393 { 394 394 buf = 0; 395 ur_binarySlice( tos, &buf, &end );395 ur_binarySlice( ut, tos, &buf, &end ); 396 396 } 397 397
