File tree 2 files changed +4
-8
lines changed
windows/native/libdt_socket
2 files changed +4
-8
lines changed Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright (c) 1998, 2020 , Oracle and/or its affiliates. All rights reserved.
2
+ * Copyright (c) 1998, 2023 , Oracle and/or its affiliates. All rights reserved.
3
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
4
*
5
5
* This code is free software; you can redistribute it and/or modify it
189
189
dbgsysSetSocketOption (int fd , jint cmd , jboolean on , jvalue value )
190
190
{
191
191
if (cmd == TCP_NODELAY ) {
192
- struct protoent * proto = getprotobyname ("TCP" );
193
- int tcp_level = (proto == 0 ? IPPROTO_TCP : proto -> p_proto );
194
192
uint32_t onl = (uint32_t )on ;
195
193
196
- if (setsockopt (fd , tcp_level , TCP_NODELAY ,
194
+ if (setsockopt (fd , IPPROTO_TCP , TCP_NODELAY ,
197
195
(char * )& onl , sizeof (uint32_t )) < 0 ) {
198
196
return SYS_ERR ;
199
197
}
Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright (c) 1998, 2022 , Oracle and/or its affiliates. All rights reserved.
2
+ * Copyright (c) 1998, 2023 , Oracle and/or its affiliates. All rights reserved.
3
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
4
*
5
5
* This code is free software; you can redistribute it and/or modify it
268
268
dbgsysSetSocketOption (int fd , jint cmd , jboolean on , jvalue value )
269
269
{
270
270
if (cmd == TCP_NODELAY ) {
271
- struct protoent * proto = getprotobyname ("TCP" );
272
- int tcp_level = (proto == 0 ? IPPROTO_TCP : proto -> p_proto );
273
271
long onl = (long )on ;
274
272
275
- if (setsockopt (fd , tcp_level , TCP_NODELAY ,
273
+ if (setsockopt (fd , IPPROTO_TCP , TCP_NODELAY ,
276
274
(char * )& onl , sizeof (long )) < 0 ) {
277
275
return SYS_ERR ;
278
276
}
You can’t perform that action at this time.
0 commit comments