Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
L
libzmq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
libzmq
Commits
4012538c
Commit
4012538c
authored
May 04, 2016
by
Doron Somech
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
problem: srcfd is broken
parent
a192663e
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
17 additions
and
72 deletions
+17
-72
msg.cpp
src/msg.cpp
+0
-19
msg.hpp
src/msg.hpp
+6
-20
socket_base.cpp
src/socket_base.cpp
+0
-17
socket_base.hpp
src/socket_base.hpp
+0
-6
socks_connecter.cpp
src/socks_connecter.cpp
+0
-3
stream_engine.cpp
src/stream_engine.cpp
+4
-0
tcp_connecter.cpp
src/tcp_connecter.cpp
+0
-3
tcp_listener.cpp
src/tcp_listener.cpp
+0
-3
zmq.cpp
src/zmq.cpp
+7
-1
No files found.
src/msg.cpp
View file @
4012538c
...
...
@@ -87,7 +87,6 @@ int zmq::msg_t::init ()
u
.
vsm
.
size
=
0
;
u
.
vsm
.
group
[
0
]
=
'\0'
;
u
.
vsm
.
routing_id
=
0
;
u
.
vsm
.
fd
=
retired_fd
;
return
0
;
}
...
...
@@ -100,7 +99,6 @@ int zmq::msg_t::init_size (size_t size_)
u
.
vsm
.
size
=
(
unsigned
char
)
size_
;
u
.
vsm
.
group
[
0
]
=
'\0'
;
u
.
vsm
.
routing_id
=
0
;
u
.
vsm
.
fd
=
retired_fd
;
}
else
{
u
.
lmsg
.
metadata
=
NULL
;
...
...
@@ -108,7 +106,6 @@ int zmq::msg_t::init_size (size_t size_)
u
.
lmsg
.
flags
=
0
;
u
.
lmsg
.
group
[
0
]
=
'\0'
;
u
.
lmsg
.
routing_id
=
0
;
u
.
lmsg
.
fd
=
retired_fd
;
u
.
lmsg
.
content
=
NULL
;
if
(
sizeof
(
content_t
)
+
size_
>
size_
)
u
.
lmsg
.
content
=
(
content_t
*
)
malloc
(
sizeof
(
content_t
)
+
size_
);
...
...
@@ -137,7 +134,6 @@ int zmq::msg_t::init_external_storage(content_t* content_, void* data_, size_t s
u
.
zclmsg
.
flags
=
0
;
u
.
zclmsg
.
group
[
0
]
=
'\0'
;
u
.
zclmsg
.
routing_id
=
0
;
u
.
zclmsg
.
fd
=
retired_fd
;
u
.
zclmsg
.
content
=
content_
;
u
.
zclmsg
.
content
->
data
=
data_
;
...
...
@@ -165,7 +161,6 @@ int zmq::msg_t::init_data (void *data_, size_t size_,
u
.
cmsg
.
size
=
size_
;
u
.
cmsg
.
group
[
0
]
=
'\0'
;
u
.
cmsg
.
routing_id
=
0
;
u
.
cmsg
.
fd
=
retired_fd
;
}
else
{
u
.
lmsg
.
metadata
=
NULL
;
...
...
@@ -173,7 +168,6 @@ int zmq::msg_t::init_data (void *data_, size_t size_,
u
.
lmsg
.
flags
=
0
;
u
.
lmsg
.
group
[
0
]
=
'\0'
;
u
.
lmsg
.
routing_id
=
0
;
u
.
lmsg
.
fd
=
retired_fd
;
u
.
lmsg
.
content
=
(
content_t
*
)
malloc
(
sizeof
(
content_t
));
if
(
!
u
.
lmsg
.
content
)
{
errno
=
ENOMEM
;
...
...
@@ -197,7 +191,6 @@ int zmq::msg_t::init_delimiter ()
u
.
delimiter
.
flags
=
0
;
u
.
delimiter
.
group
[
0
]
=
'\0'
;
u
.
delimiter
.
routing_id
=
0
;
u
.
delimiter
.
fd
=
retired_fd
;
return
0
;
}
...
...
@@ -208,7 +201,6 @@ int zmq::msg_t::init_join ()
u
.
base
.
flags
=
0
;
u
.
base
.
group
[
0
]
=
'\0'
;
u
.
base
.
routing_id
=
0
;
u
.
base
.
fd
=
retired_fd
;
return
0
;
}
...
...
@@ -219,7 +211,6 @@ int zmq::msg_t::init_leave ()
u
.
base
.
flags
=
0
;
u
.
base
.
group
[
0
]
=
'\0'
;
u
.
base
.
routing_id
=
0
;
u
.
base
.
fd
=
retired_fd
;
return
0
;
}
...
...
@@ -400,16 +391,6 @@ void zmq::msg_t::reset_flags (unsigned char flags_)
u
.
base
.
flags
&=
~
flags_
;
}
zmq
::
fd_t
zmq
::
msg_t
::
fd
()
{
return
u
.
base
.
fd
;
}
void
zmq
::
msg_t
::
set_fd
(
fd_t
fd_
)
{
u
.
base
.
fd
=
fd_
;
}
zmq
::
metadata_t
*
zmq
::
msg_t
::
metadata
()
const
{
return
u
.
base
.
metadata
;
...
...
src/msg.hpp
View file @
4012538c
...
...
@@ -105,8 +105,6 @@ namespace zmq
unsigned
char
flags
();
void
set_flags
(
unsigned
char
flags_
);
void
reset_flags
(
unsigned
char
flags_
);
fd_t
fd
();
void
set_fd
(
fd_t
fd_
);
metadata_t
*
metadata
()
const
;
void
set_metadata
(
metadata_t
*
metadata_
);
void
reset_metadata
();
...
...
@@ -139,8 +137,7 @@ namespace zmq
enum
{
max_vsm_size
=
msg_t_size
-
(
sizeof
(
metadata_t
*
)
+
3
+
16
+
sizeof
(
uint32_t
)
+
sizeof
(
fd_t
))};
sizeof
(
uint32_t
))};
private
:
zmq
::
atomic_counter_t
*
refcnt
();
...
...
@@ -179,13 +176,11 @@ namespace zmq
unsigned
char
unused
[
msg_t_size
-
(
sizeof
(
metadata_t
*
)
+
2
+
16
+
sizeof
(
uint32_t
)
+
sizeof
(
fd_t
))];
sizeof
(
uint32_t
))];
unsigned
char
type
;
unsigned
char
flags
;
char
group
[
16
];
uint32_t
routing_id
;
fd_t
fd
;
}
base
;
struct
{
metadata_t
*
metadata
;
...
...
@@ -195,7 +190,6 @@ namespace zmq
unsigned
char
flags
;
char
group
[
16
];
uint32_t
routing_id
;
fd_t
fd
;
}
vsm
;
struct
{
metadata_t
*
metadata
;
...
...
@@ -204,13 +198,11 @@ namespace zmq
sizeof
(
content_t
*
)
+
2
+
16
+
sizeof
(
uint32_t
)
+
sizeof
(
fd_t
))];
sizeof
(
uint32_t
))];
unsigned
char
type
;
unsigned
char
flags
;
char
group
[
16
];
uint32_t
routing_id
;
fd_t
fd
;
}
lmsg
;
struct
{
metadata_t
*
metadata
;
...
...
@@ -219,13 +211,11 @@ namespace zmq
sizeof
(
content_t
*
)
+
2
+
16
+
sizeof
(
uint32_t
)
+
sizeof
(
fd_t
))];
sizeof
(
uint32_t
))];
unsigned
char
type
;
unsigned
char
flags
;
char
group
[
16
];
uint32_t
routing_id
;
fd_t
fd
;
}
zclmsg
;
struct
{
metadata_t
*
metadata
;
...
...
@@ -236,26 +226,22 @@ namespace zmq
sizeof
(
size_t
)
+
2
+
16
+
sizeof
(
uint32_t
)
+
sizeof
(
fd_t
))];
sizeof
(
uint32_t
))];
unsigned
char
type
;
unsigned
char
flags
;
char
group
[
16
];
uint32_t
routing_id
;
fd_t
fd
;
}
cmsg
;
struct
{
metadata_t
*
metadata
;
unsigned
char
unused
[
msg_t_size
-
(
sizeof
(
metadata_t
*
)
+
2
+
16
+
sizeof
(
uint32_t
)
+
sizeof
(
fd_t
))];
sizeof
(
uint32_t
))];
unsigned
char
type
;
unsigned
char
flags
;
char
group
[
16
];
uint32_t
routing_id
;
fd_t
fd
;
}
delimiter
;
}
u
;
};
...
...
src/socket_base.cpp
View file @
4012538c
...
...
@@ -197,7 +197,6 @@ zmq::socket_base_t::socket_base_t (ctx_t *parent_, uint32_t tid_, int sid_, bool
last_tsc
(
0
),
ticks
(
0
),
rcvmore
(
false
),
file_desc
(
-
1
),
monitor_socket
(
NULL
),
monitor_events
(
0
),
thread_safe
(
thread_safe_
),
...
...
@@ -1215,8 +1214,6 @@ int zmq::socket_base_t::recv (msg_t *msg_, int flags_)
// If we have the message, return immediately.
if
(
rc
==
0
)
{
if
(
file_desc
!=
retired_fd
)
msg_
->
set_fd
(
file_desc
);
extract_flags
(
msg_
);
EXIT_MUTEX
();
return
0
;
...
...
@@ -1238,8 +1235,6 @@ int zmq::socket_base_t::recv (msg_t *msg_, int flags_)
EXIT_MUTEX
();
return
rc
;
}
if
(
file_desc
!=
retired_fd
)
msg_
->
set_fd
(
file_desc
);
extract_flags
(
msg_
);
EXIT_MUTEX
();
...
...
@@ -1279,8 +1274,6 @@ int zmq::socket_base_t::recv (msg_t *msg_, int flags_)
}
}
if
(
file_desc
!=
retired_fd
)
msg_
->
set_fd
(
file_desc
);
extract_flags
(
msg_
);
EXIT_MUTEX
();
return
0
;
...
...
@@ -1646,16 +1639,6 @@ int zmq::socket_base_t::monitor (const char *addr_, int events_)
return
rc
;
}
void
zmq
::
socket_base_t
::
set_fd
(
zmq
::
fd_t
fd_
)
{
file_desc
=
fd_
;
}
zmq
::
fd_t
zmq
::
socket_base_t
::
fd
()
{
return
file_desc
;
}
void
zmq
::
socket_base_t
::
event_connected
(
const
std
::
string
&
addr_
,
int
fd_
)
{
if
(
monitor_events
&
ZMQ_EVENT_CONNECTED
)
...
...
src/socket_base.hpp
View file @
4012538c
...
...
@@ -123,9 +123,6 @@ namespace zmq
int
monitor
(
const
char
*
endpoint_
,
int
events_
);
void
set_fd
(
fd_t
fd_
);
fd_t
fd
();
void
event_connected
(
const
std
::
string
&
addr_
,
int
fd_
);
void
event_connect_delayed
(
const
std
::
string
&
addr_
,
int
err_
);
void
event_connect_retried
(
const
std
::
string
&
addr_
,
int
interval_
);
...
...
@@ -264,9 +261,6 @@ namespace zmq
// True if the last message received had MORE flag set.
bool
rcvmore
;
// File descriptor if applicable
fd_t
file_desc
;
// Improves efficiency of time measurement.
clock_t
clock
;
...
...
src/socks_connecter.cpp
View file @
4012538c
...
...
@@ -152,9 +152,6 @@ void zmq::socks_connecter_t::in_event ()
if
(
rc
==
-
1
)
error
();
else
{
// Remember our fd for ZMQ_SRCFD in messages
socket
->
set_fd
(
s
);
// Create the engine object for this connection.
stream_engine_t
*
engine
=
new
(
std
::
nothrow
)
stream_engine_t
(
s
,
options
,
endpoint
);
...
...
src/stream_engine.cpp
View file @
4012538c
...
...
@@ -985,6 +985,10 @@ void zmq::stream_engine_t::set_handshake_timer ()
bool
zmq
::
stream_engine_t
::
init_properties
(
properties_t
&
properties
)
{
if
(
peer_address
.
empty
())
return
false
;
properties
.
insert
(
std
::
make_pair
(
"Peer-Address"
,
peer_address
));
// Private property to support deprecated SRCFD
std
::
string
fd_string
=
static_cast
<
std
::
ostringstream
*>
(
&
(
std
::
ostringstream
()
<<
(
int
)
s
))
->
str
();
properties
.
insert
(
std
::
make_pair
(
"__fd"
,
fd_string
));
return
true
;
}
...
...
src/tcp_connecter.cpp
View file @
4012538c
...
...
@@ -151,9 +151,6 @@ void zmq::tcp_connecter_t::out_event ()
options
.
tcp_keepalive_idle
,
options
.
tcp_keepalive_intvl
);
tune_tcp_maxrt
(
fd
,
options
.
tcp_maxrt
);
// remember our fd for ZMQ_SRCFD in messages
socket
->
set_fd
(
fd
);
// Create the engine object for this connection.
stream_engine_t
*
engine
=
new
(
std
::
nothrow
)
stream_engine_t
(
fd
,
options
,
endpoint
);
...
...
src/tcp_listener.cpp
View file @
4012538c
...
...
@@ -105,9 +105,6 @@ void zmq::tcp_listener_t::in_event ()
options
.
tcp_keepalive_idle
,
options
.
tcp_keepalive_intvl
);
tune_tcp_maxrt
(
fd
,
options
.
tcp_maxrt
);
// remember our fd for ZMQ_SRCFD in messages
socket
->
set_fd
(
fd
);
// Create the engine object for this connection.
stream_engine_t
*
engine
=
new
(
std
::
nothrow
)
stream_engine_t
(
fd
,
options
,
endpoint
);
...
...
src/zmq.cpp
View file @
4012538c
...
...
@@ -680,11 +680,17 @@ int zmq_msg_more (zmq_msg_t *msg_)
int
zmq_msg_get
(
zmq_msg_t
*
msg_
,
int
property_
)
{
const
char
*
fd_string
;
switch
(
property_
)
{
case
ZMQ_MORE
:
return
(((
zmq
::
msg_t
*
)
msg_
)
->
flags
()
&
zmq
::
msg_t
::
more
)
?
1
:
0
;
case
ZMQ_SRCFD
:
return
(
int
)((
zmq
::
msg_t
*
)
msg_
)
->
fd
();
fd_string
=
zmq_msg_gets
(
msg_
,
"__fd"
);
if
(
fd_string
==
NULL
)
return
(
int
)
-
1
;
return
atoi
(
fd_string
);
case
ZMQ_SHARED
:
return
(((
zmq
::
msg_t
*
)
msg_
)
->
is_cmsg
())
||
(((
zmq
::
msg_t
*
)
msg_
)
->
flags
()
&
zmq
::
msg_t
::
shared
)
?
1
:
0
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment